News for hackers. Stuff that matters.
Re:Stop using JWT for sessions (2016) by nbevans on Thursday November 01, 2018 @10:55AM (#18354446)
Sure why not? Each user account has a counter or timestamp on it in the user registry. If the JWT token in the request passes crypto validation but it has an older counter/timestamp than held in the user registry then it is deemed invalid and the user must re-authenticate. This is still a horizontally scalable design.
Re:Stop using JWT for sessions (2016) by gravypod on Thursday November 01, 2018 @11:01AM (#18354510)
Then you are back to statefulness if you need to check this magic "count" every request.
Re:Stop using JWT for sessions (2016) by nbevans on Friday November 02, 2018 @09:14AM (#18362752)
You can horizontally scale counters with CRDTs, specifically the G-Counter. Whereas it is harder to scale a (usually) opaque blob of application state a.k.a. session state.
Re:Stop using JWT for sessions (2016) by aaaaaaaaaab on Thursday November 01, 2018 @12:10PM (#18355407)
This “user registry” of yours sounds an awful lot like a traditional session table in a central DB.

Could you elaborate a bit on that in terms of horizontal scalability please?

Re:Stop using JWT for sessions (2016) by nbevans on Friday November 02, 2018 @09:13AM (#18362739)
User registry can scaled however you want it to be. It is simply the service that manages user accounts, passwords, permissions, and of course issues the JWT tokens. Equally it can be a horizontally scaled micro service.