Open sleenen opened 7 years ago
Obviously you linked to my issue but just wanted to re-iterate this is exactly what I am looking to do.
I'm using 1.0.0-alpha.3 by the way.
@tymondesigns any thoughts on this? I see the code has changed in the 1.0.0-beta.2, making it unclear for me where the actual checking on the time difference is done. Gonna have to look into that.
Isn't this on purpose so you can't indefinitely chain refresh tokens?
Here's what I did to try and fix this.
A token is set to a specific user through the custom claim, if I detect that the token is within three hours of expiring, I generate a new Token based on the JWTSubject.
You can still indefinitely chain refresh tokens but by setting this time period to a low number you mitigate some risks.
@Mark-Hoog Could you please drop some demo code to see how you check the expiration time of the token?
After refreshing a token and getting back a new valid token. The issued at time (IAT) claim remains the same as intended. However the validate refresh code looks like this and checks based on that IAT:
Should this not be checked against the expiry (EXP) claim, so that the 'new'/refreshed token again has the refreshTTL to be able to refresh this newly created token and the refreshTTL gets reset basically for this new token.