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

There is no way to force-logout JWT tokens #1810

Open
notramo opened this issue May 8, 2023 · 4 comments
Open

There is no way to force-logout JWT tokens #1810

notramo opened this issue May 8, 2023 · 4 comments
Labels
feature request A new requested feature / option

Comments

@notramo
Copy link

notramo commented May 8, 2023

Lucky does not have a way to revoke API authentication JWT token. While the clients can delete it themselves, force-logout (e.g. lost device) is not possible.

Worth reading:
https://evertpot.com/jwt-is-a-bad-default/

What about providing a database-based session too?

@notramo notramo added the bug label May 8, 2023
@notramo
Copy link
Author

notramo commented Jul 16, 2023

Any thoughts on this?

@jwoertink
Copy link
Member

I'm not familiar with how this works, but it sounds like a nice idea to add. I'd be open to a PR. Probably would have to go in https://github.com/luckyframework/authentic ?

@jwoertink jwoertink added feature request A new requested feature / option and removed bug labels Jul 16, 2023
@mdwagner
Copy link
Contributor

A simple solution, if you're already using JWTs, is to just store the JWTs in the database and validate them on every API endpoint. Obviously, this defeats the purpose of JWTs, but it would gain the ability to revoke them.

Could you provide more context on what you're looking for?

@robacarp
Copy link
Contributor

One scenario which would require a system to provide a removal of existing sessions is this. When your account is suspected of compromise, it's important to be able to log out all existing sessions before changing your password. Otherwise, someone who is logged in can easily stay logged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new requested feature / option
Projects
None yet
Development

No branches or pull requests

4 participants