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

Support revocation of access tokens #187

Open
zachlipton opened this issue Oct 21, 2020 · 0 comments
Open

Support revocation of access tokens #187

zachlipton opened this issue Oct 21, 2020 · 0 comments

Comments

@zachlipton
Copy link
Collaborator

We currently accept any valid JWT token as a database password, which doesn't leave us a way to invalidate an individual token without changing the secret key and invalidating all of them.

To do this we'll need:

  • To add a really simple postgres table containing usernames to be denied access. This can probably just be a one-column table (plus an index) that we edit manually given the rarity of needing to revoke access. Define the table in app/models/data.py and create a migration .
  • Implement flask_jwt_extended's blocklisting function , @jwt.token_in_blacklist_loader, to check if the token's identity matches a blocklisted username.

By all means shout in my general direction if this is unclear or there are any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant