question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better documentation on revoking request tokens

See original GitHub issue

Hey all,

I came across #53 which talks about how to revoke a refresh token. It is kind of unclear what exactly this comment references https://github.com/vimalloc/flask-jwt-extended/issues/53#issuecomment-309292786 and revoking refresh tokens isn’t mentioned anywhere else. The only place with some documentation is this random site: https://darksun-flask-jwt-extended.readthedocs.io/en/latest/blacklist_and_token_revoking/ which does not appear to be official, or even tell you what version it’s talking about, and it doesn’t work anyway.

Basically I’d just like a blurb to be added to the refresh token page saying that they can be revoked in the same way as auth tokens as long as verify_jwt_in_request(refresh=True) (or the equivalent decorator) is included. It’s just too easy to slip a developer’s mind that refresh tokens do indeed need to be revoked, to prevent generating a new access token after one was invalidated.

I think there’s also a possible implementation of allowing tokens to be tied a session cookie, then invalidating all refresh/access tokens for a specific session via a logout endpoint. But that’s complicated above my use case.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tgross35commented, Dec 2, 2021

@Jordon-Chen you’re lucky to have caught me in the midst of a long docker build 😃

My current method is like you said: I have /auth/access and /auth/refresh routes that accept POST to generate and DELETE to revoke access and refresh tokens, respectively.

You could theoretically have one endpoint that does it all using verify_jwt_in_request(optional=True) with and without refresh=True and seeing which one returns, but that seemed more effort than it’s worth.

0reactions
tgross35commented, Jan 8, 2022

@vimalloc I just wrapped up changes for this in #460, take a look when you get a chance

I think this will play nicely with #441. The new argument I added verify_type currently accepts a bool - this could be expanded to accept a string or iterable of a custom type. If you OK #460, I’ll look at bringe #441 in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Revoke Refresh Tokens - Auth0
Learn how to revoke a refresh token if it gets compromised using the Authentication API, the Management API, or the Auth0 Dashboard.
Read more >
Approving and revoking access tokens | Apigee Edge
Approving access and refresh tokens​​ Use the ValidateToken operation to "re-approve" a revoked token. That is, when you apply this operation, the status...
Read more >
Revoke tokens | Apple Developer Documentation
The user refresh token or access token intended to be revoked. The user session associated with the token provided is revoked if the...
Read more >
Revoking and approving tokens | Apigee X - Google Cloud
Note: You cannot revoke a JWT access token. You can revoke only opaque OAuth tokens, either access tokens or refresh tokens, that have...
Read more >
Revoke Tokens - Okta Developer
If you would like to disable an access or refresh token, simply send a request to the /revoke endpoint for the appropriate Authorization...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found