Best way to do Session authentication with quarkus-security? #50809
-
|
I like the quarkus-security extension and noticed there isn't a built-in way of doing http sessions, not even an extension for easy management of sessions/cookies. I understand quarkus' focus is on micro-services, but nobody is storing session information in memory, they will always be using something like Redis. JWTs are hard to invalidate (can be fixed with refresh tokens and access tokens, which should be stored anyway in a db) and the data from a token will eventually get stale, which can cause security issues. If I still want to do session based authentication like this, what are my best options? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
/cc @sberyozkin (security) |
Beta Was this translation helpful? Give feedback.
-
I only judge from this link as I have never tried Micronaut, but I didn't see on that page anything you can't do with the form-based authentication. In fact, it sounds like form-based authentication to me. Session cookie serves just as an identifier so that we don't need to send credentials on every request, there is no other information there. If you need persistent storage, I'd go with OIDC extension as we have redis/db token state managers. But yeah, as Sergey mentioned we don't have other persistent session storage options. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for the query,
In general, a session based authentication term is often mixed up with stateless vs stateful session data storage.
Contrasting, for example,
session based authenticationvsJWT based authenticationis incorrect and misleading.Session based authenticationis always about depending on a cookie as a link between the browser and the server to represent an active user session. It is supported with either a stateful approach where the cookie is a binary pointer into a server-hosted session data, or a stateless approach where the encrypted cookie contains all the session related data.It is what this is all about, nothing to do with micro services. The use of
HTTP session