We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! I am using OAuth2Session as follows:
OAuth2Session
with open(token_filepath) as src: token = json.load(src) def token_saver(token): with open(token_filepath, "w") as dst: json.dump(token, dst) session = requests_oauthlib.OAuth2Session( client_id, token=token, auto_refresh_url=REFRESH_TOKEN_URL, auto_refresh_kwargs={"client_id": client_id, "client_secret": client_secret}, token_updater=token_saver, ) response = session.get( SOME_URL, data=some_dict, ) response.raise_for_status()
It works at first but once the token expires, a 403 error is raised at the last line. The logs revel that the self._client.add_token call in the OAuth2Session.request does not raise any TokenExpiredError, so the token is not updated and then I get the 403 error.
self._client.add_token
OAuth2Session.request
TokenExpiredError
Am I missing something, or is this a peculiarity of the web service and I should thus implement an ad-hoc solution for my use case?
Thank you. Best, Martí
The text was updated successfully, but these errors were encountered:
Did you ever solve this? I'm seeing exactly the same thing
Sorry, something went wrong.
I'm getting this, too.
The oauthlib is raising the TokenExpiredError but Oauth2Session is not raising it or triggering auto refresh
No branches or pull requests
Hello! I am using
OAuth2Session
as follows:It works at first but once the token expires, a 403 error is raised at the last line. The logs revel that the
self._client.add_token
call in theOAuth2Session.request
does not raise anyTokenExpiredError
, so the token is not updated and then I get the 403 error.Am I missing something, or is this a peculiarity of the web service and I should thus implement an ad-hoc solution for my use case?
Thank you. Best,
Martí
The text was updated successfully, but these errors were encountered: