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.

Revoke current token

See original GitHub issue

I am implementing an API in flask using your lovely library for a jwt-based authentication. I would like to offer the authenticated client the option to revoke its own token (“logout”). How would I implement this? I am using redis for the blacklist backend. As far as I can tell, the only way to revoke a token is by its jti. However, the library only stores the identity and the user claims on the app context.

Would it make sense to store the full jwt on the app context and have the get_jwt_identity and get_jwt_claims functions just return the appropriate fields? This would allow for another function that returns the jti.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vimalloccommented, Jan 11, 2017

That seems perfectly reasonable to me. We can add a new get_raw_jwt or something along those lines. We could take it a step farther and also add a get_jwt_jti method as well, if that would make things simpler.

I’ll see about getting a new released pushed which addresses this later today.

Thanks for the feedback! 👍

0reactions
vimalloccommented, Jan 12, 2017

Thanks 😃

That is released as version 1.1.0. It should be available on pypi shortly. I’m going to go ahead and close this issue, but if any problems come up, please go ahead and re-open it.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Revoke Tokens - Auth0
Describes how to use tokens to control user access. ... Once issued, access tokens and ID tokens cannot be revoked in the same...
Read more >
Revoking tokens - Amazon Cognito - AWS Documentation
You can revoke a refresh token for a user using the AWS API. When you revoke a refresh token, all access tokens that...
Read more >
Revoke Tokens - Okta Developer
This guide explains how to revoke access or refresh tokens with Okta. Learning outcomes. Revoke tokens. Remove user sessions. About the revoke request....
Read more >
token revoke - Command | Vault - HashiCorp Developer
The "token revoke" revokes authentication tokens and their children. If a TOKEN is not provided, the locally authenticated token is used.
Read more >
OAuth 2.0 Token Revocation
The Token Revocation extension defines a mechanism for clients to indicate to the authorization server that an access token is no longer needed....
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