Re:Why JWTs Suck as Session Tokens (2017)
by sudovoodoo on Thursday August 30, 2018 @12:27PM
(#17877996)
If your using a salt, just change the salt and deploy. We frequently do this and it works great. All existing tokens are expired.
Re:Why JWTs Suck as Session Tokens (2017)
by drinchev on Thursday August 30, 2018 @12:32PM
(#17878059)
So you invalidate all tokens? Or it is per user ID salt. If the latter where do you keep the salts and why not simply having a server side session ID, instead of the salt
Re:Why JWTs Suck as Session Tokens (2017)
by pkulak on Thursday August 30, 2018 @12:26PM
(#17877991)
If you have your tokens take more than an hour to expire, you're doing it wrong.
Re:Why JWTs Suck as Session Tokens (2017)
by drinchev on Thursday August 30, 2018 @12:30PM
(#17878033)
Refreshing a specific token can not be blocked on the server side. If you do, it’s already stateful.
I am of the anti-JWT crowd, so I completely agree, but this would still only hit a "login service" which would know if a new JWT could be given to this token.
Still, an hour is a LONG TIME when a session could just kill all requests immediately for a user.
Re:Why JWTs Suck as Session Tokens (2017)
by pkulak on Thursday August 30, 2018 @12:52PM
(#17878252)
If that's the case, then why refresh? Might as well just hand out forever tokens, which, you're right, makes less than zero sense.
The point is that you have two tokens, one a refresh token and one a stateless token. You revoke the refresh token on the server, which means the next refresh attempt will fail.
Re:Why JWTs Suck as Session Tokens (2017)
by ortekk on Thursday August 30, 2018 @02:13PM
(#17879179)
Then why not just use "refresh token" as a session token?
Re:Why JWTs Suck as Session Tokens (2017)
by pkulak on Thursday August 30, 2018 @04:45PM
(#17880583)
Because it's stored and that would require a round trip to your auth server on every request. Plus, its security requirements are far higher than the access token, so you don't want to be flinging it all over the internet. It only ever goes between your users and your auth server.
Same happens on reset password, where by the book you need to sign out the user from every device. Good luck with that having standard JWT implementation.