The Wayback Machine - https://web.archive.org/web/20201129193541/https://github.com/lepture/authlib/issues/144
Skip to content
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

Flask OAuth Client: refreshed token is not used #144

Closed
yclybouw opened this issue Aug 17, 2019 · 1 comment
Closed

Flask OAuth Client: refreshed token is not used #144

yclybouw opened this issue Aug 17, 2019 · 1 comment

Comments

@yclybouw
Copy link

@yclybouw yclybouw commented Aug 17, 2019

Using version 0.11

File: authlib/flask/client/oauth.py
Class: RemoteApp

  1. The first time a "authenticated" request is made, the RemoteApp.token property will fetch the token with RemoteApp._fetch_token and put it on Flask's _app_ctx_stack.
  2. Each subsequent request will not use RemoteApp._fetch_token, but the cached token from _app_ctx_stack.
  3. If the token has expired, a new token will be requested (authlib/oauth2/client.py:OAuth2Client), it is updated in this session object, but this not propagate to RemoteApp, nor _app_ctx_stack.
  4. Next request, RemoteApp.token will still return the old token from _app_ctx_stack.
@lepture
Copy link
Owner

@lepture lepture commented Aug 22, 2019

fixed by 4d570fa

@lepture lepture closed this Aug 22, 2019
lepture added a commit that referenced this issue Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.