Closed thiras closed 4 years ago
I've changed token type with "Bearer" manually and it worked.
I'm having this same issue with another provider. @thiras, if you don't mind - please could you tell me how you changed the token_type
manually?
@sambragg sure. Check my solution here; https://stackoverflow.com/a/61001852/4132845
Also check register_compliance_hook
at the official docs.
This is great, thank you so much @thiras
@thiras I couldn't get your solution to work. Incase anyone else has this issue, what I ended up doing was the following:
import json
from oauthlib.common import to_unicode
self.oauth.register_compliance_hook('access_token_response', self.non_compliant_token)
self.oauth.register_compliance_hook('refresh_token_response', self.non_compliant_token)
def non_compliant_token(self, response):
token = json.loads(response.text)
token["token_type"] = "Bearer"
fixed_token = json.dumps(token)
response._content = to_unicode(fixed_token).encode("utf-8")
return response
This avoids having to create a fake class etc.
Hello. I've got some error after successfully obtain a token from eBay.
As you can see at its documentation eBay returns
"token_type": "User Access Token"
After getting the token without having a problem, when I try to request anything from its endpoint I get;