private function createBearerToken(OAuthResponse $response)
    {
        if (!$response->hasData('token_type') || !$response->hasData('access_token')) {
            throw new OAuthException('An error occured when creating the bearer token.', $response);
        }

        return new BearerToken($response->getData('access_token'));
    }