Re:Stop using JWT for sessions (2016)
by anon1252 on Thursday November 01, 2018 @10:36AM
(#18354237)
The idea of JWT is basically you give your user a "token" that can be used against many "services" while servers don't have to persist the state of that token, just be able to read the encrypted token, and trust the information in the token. The obvious issue is the server cannot easily revoke that token without blacklisting it, therefore persisting that token somewhere on a blacklist on the server. If you are going to make a lookup for a token in a blacklist you might as well look up for a session ID to being with.
[ Parent
| on HN ]
Re:Stop using JWT for sessions (2016)
by redbeard0x0a on Thursday November 01, 2018 @11:50AM
(#18355155)
Traversing a list of 100,000 users/sessions in a db to pull up the session is a different beast compared to traversing an in memory list of 10-100 revoked JTIs in redis. It is a lot less data to store and optimize (the full session vs. a small list of revoked JTIs)
Re:Stop using JWT for sessions (2016)
by anon1252 on Thursday November 01, 2018 @12:58PM
(#18356014)
> Traversing a list of 100,000 users/sessions in a db to pull up the session is a different beast compared to traversing an in memory list of 10-100 revoked JTIs in redis. It is a lot less data to store and optimize (the full session vs. a small list of revoked JTIs)
I don't see why one can't use redis to persist sessions at first place and why your list of revoked token would be limited to 100.
It does depend on how many users you have and your TTL for the JWT, but if you have a 10 minute time to live, you only need to store the revocations for 10 minutes in redis since otherwise the tokens themselves expire. (Just an example, sub 10 minutes with 24 hours or whatever)