Answer the question
In order to leave comments, you need to log in
How to properly invalidate JWT tokens?
Faced with, at first glance, not a difficult task. Namely - how to properly invalidate a token? For example, if the user logs out or changes their password.
Briefly about the task: there is a regular REST API in which part of the functionality requires the user to be authorized. We implement this through JWT.
Searching the web for answers, I found a few ideas about this:
Answer the question
In order to leave comments, you need to log in
To do this, use fast storage, not a database (ala radish). We store the secret key for tokens in radish (each token has its own). When you exit, update the key. Well and of course we forget on the client.
In the radish, there are entries like
user_id : secret
According to this scheme, everyone works.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question