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

JWT token invalidation after password change #247

Open
2 tasks
DDmit04 opened this issue Feb 22, 2021 · 3 comments
Open
2 tasks

JWT token invalidation after password change #247

DDmit04 opened this issue Feb 22, 2021 · 3 comments
Labels
defining-requirements Defining feature requirements triage

Comments

@DDmit04
Copy link
Contributor

DDmit04 commented Feb 22, 2021

⚠️ Is your feature request related to a problem? Please describe

After user change password all login sessions (and JWT tokens) stay valid

💡 Describe the solution you'd like

Add an invalid token store (in Redis for example) which automatically delete tokens on expiration

🤚 Do you want to develop this feature yourself?

  • Yes
  • No
@mslowiak mslowiak added defining-requirements Defining feature requirements triage labels Feb 23, 2021
@JanneSickert
Copy link
Contributor

I will try to fix that issure

@Ikhiloya
Copy link

I see that this is still open, I'd like to try it out.

Here's my solution approach:

  1. Create a Redis token store for tokens to be invalidated after a user has changed password.
  2. The token store will hold the token, issuedAt and expiry data.
  3. Once the user's password is changed, the token , issuedAt and expiry fields are stored. This will require decoding the token.
  4. A chron job would run in the background to delete tokens whose expiry is less than the current time from the Redis token store.
  5. The login workflow has to be modified to intercept and check for tokens for which the user has changed the password. That is, the doFilter() method of the JwtFilter should check the Redis token store for the request token and if it does, should return an authorized response. Of course, this will lead to an additional query for each request for a resource but performance will not be hampered since Redis has a fast search mechanism.

@MargotRasamy
Copy link

Hello ! I'd like to work on this with my friend @salamisodikiolawale for a school assignment. Could you assign it to me please ? and to my friend too if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defining-requirements Defining feature requirements triage
Projects
None yet
Development

No branches or pull requests

5 participants