Answer the question
In order to leave comments, you need to log in
What's the point of a refresh token?
I don’t fully understand why refresh tokens are still needed.
Let's say an attacker stole an acess token from us, which lives for a very short time, say 15 minutes. Ok, he will be able to use it for a short time, and having a refresh token we will get a new access token. With this, everything is clear and logical.
But what happens if the attacker also steals the refresh token? And here I do not understand anything. First, why if he stole the access token, then he does not have the opportunity to steal the refresh token as well? Or are most attackers too stupid, when they see an access token they immediately drool and forget that they really need a refresh?
If an attacker steals a refresh token, he will also be able to use it until it expires, constantly getting a new pair. Everyone says that when a user logs in, the attacker's refresh token will become invalid. It turns out that we need to store it somewhere in the repository and delete it with each new login? Ok, then how not to log out on other devices when logging in if we need to delete all the refresh tokens?
In general, help me deal with this abracadabra;)
Answer the question
In order to leave comments, you need to log in
But what happens if the attacker also steals the refresh token?
Access token constantly walks along the wires, it is relatively easy to intercept it and therefore it is often changed. Refresh token is sent much less often, the second line of defense, deep rear.)) Is such simple logic not good? And then everything breaks...
Here JavaScript.Ninja explains everything in detail. Specifically, at 13:30 he answers the question "What is the point of a refresh token?"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question