Reputation: 233
Recently I have been reading about RTR (Refresh Token Rotation). After going over many blogs, docs, and various StackOverflow answers, I didn't find an appropriate solution for a couple of questions.
Can someone please guide me here, Thank You.
Upvotes: 0
Views: 480
Reputation: 19941
To answer your questions
The one-time refresh token approach will give you a new refresh token every time it is used. But you don't refresh it for each access token usage. The token still has a custom lifetime of your choosing. can be 5 minutes, 1 hour or 1 week. The big idea of rotation is to make it harder for a hacker to also use the same refresh token. If the token is used by both the hacker and you, then you are automatically signed-out.
In the implementations that I have used, you typically only keep the latest received refresh token in the client, so if two different ones are issued, you only keep the latest one.
In general these questions are a bit "it depends" and I guess they all handle this slightly different.
if we look at the database table for IdentityServer, we see that it also contains a SessionID, so if you do login multiple times, you will get separate tokens, as the session is different.
Upvotes: 1