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

Add database backed logging #8

Open
ollieread opened this issue Jan 12, 2020 · 2 comments
Open

Add database backed logging #8

ollieread opened this issue Jan 12, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ollieread
Copy link
Member

Add the ability to enable JWT id logging in the database along with corresponding expiration timestamps.

The database should only store the jti, aud and exp claims. It should have a flag for revoking tokens and an optional command to clean any entries that have expired.

@ollieread ollieread added the enhancement New feature or request label Jan 12, 2020
@ollieread ollieread self-assigned this Jan 12, 2020
@ludo237
Copy link

ludo237 commented Jan 18, 2020

You can leverage a json column to store every claims

@ollieread
Copy link
Member Author

ollieread commented Jan 18, 2020

@ludo237 I'd like to avoid storing every claim. The reason for the selected ones above are for several reasons:

  • jti This is the id that represents the JWT token and can be used to quickly query, allowing you to blacklist, etc
  • aud This allows you to see which audience the JWT token was for, this is particularly useful if you have a JWT issuer for multiple audiences (like I do)
  • exp This is stored so that, if necessary, the rows can be pruned once tokens have expired

The idea is not to backup the JWT in the database, as that's sort of pointless. It's to instead keep a log of JWTs being issued.

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

No branches or pull requests

2 participants