Re:Stop using JSON Web Tokens for user sessions
by poxrud on Saturday November 25, 2023 @10:09AM
(#38413971)
You do need a database if you want the ability to log users out server side. This is usually done through a second refresh token.
Re:Stop using JSON Web Tokens for user sessions
by Moneysac on Saturday November 25, 2023 @03:46PM
(#38416545)
In a single page application it is necessary to access the JWT with JavaScript. Thats why it is so common to save it in the code directly or in the local storage. It is dangerous though, since a XSS vulnerability can be used to access the JWT. This would be totally different with a cookie that is stored with HttpOnly.
Yes, things like Keycloak and such follow _bad practice_. Still not the fault of JWT.