def clean_oauth_auth(self, access_token):
"""Override of oauth_auth since Xing doesn't like callback_uri
and oauth_verifier on authenticated API calls"""
key, secret = self.get_key_and_secret()
resource_owner_key = access_token.get('oauth_token')
resource_owner_secret = access_token.get('oauth_token_secret')
if not resource_owner_key:
raise AuthTokenError(self, 'Missing oauth_token')
if not resource_owner_secret:
raise AuthTokenError(self, 'Missing oauth_token_secret')
# decoding='utf-8' produces errors with python-requests on Python3
# since the final URL will be of type bytes
decoding = None if six.PY3 else 'utf-8'
return OAuth1(key, secret,
resource_owner_key=resource_owner_key,
resource_owner_secret=resource_owner_secret,
signature_type=SIGNATURE_TYPE_AUTH_HEADER,
decoding=decoding)
评论列表
文章目录