-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
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
Refresh token won´t work #10
Comments
David, Have you been able to run this code successfully? |
Is this still an issue or can I close this? |
@MendeleyStack: Rather than "closing" this, I suggest you make his edits to the source so we can all benefit downstream. The problem is easily replicable and easily solved, thanks to his well-written explanation, but only if you have credentials to fix the codebase. Alternatively, please provide an alternative method for auto-refreshing expired tokens. Thanks! |
I dont know if it is related, but very regularly I get the following error:
I authenticate using: mendel = Mendeley(CLIENT_ID, CLIENT_SECRET)
session = mendel.start_client_credentials_flow().authenticate() But I imagine the error happens whenever the token expires. How to fix it? |
When I use your mendeley-api-python-example and the access token gets expired I expected the access token gets refreshed automatically, but it won´t.
So here in are the steps to reproduce:
expected result
the
access_token
will be refreshed with therefresh_token
actual result
TokenExpiredError
expected fix: using
MendeleyAuthorizationCodeTokenRefresher
I expected to fix this bug by using
MendeleyAuthorizationCodeTokenRefresher
in mendeley-example.py#L101So I change the method to:
actual result
TokenExpiredError
and log:
No new refresh token given. Re-using old.
possible fix in
MendeleyAuthorizationCodeAuthenticator
the problem is
oauth.refresh_token
try to find a refresh token his object, but because theOAuth2Session
object is recreated this token must be passed explicit:This should be fixed the bug
regards,
david
The text was updated successfully, but these errors were encountered: