softwaremill / akka-http-session

Web & mobile client-side akka-http sessions, with optional JWT support

Home Page:https://softwaremill.com/open-source/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: can Cassandra be used as "session"?

nmarasoiu opened this issue · comments

Hi, we have AkkaHttp & Cassandra microservices and would need to keep access/refresh tokens by users for the authorization code flow. Is the http session pluggable in AkkaHttp? Or should we directly work with C* (Cassandra) to store/retrieve tokens? thank you

There's a pluggable storage for remember-me tokens, you have to implement the RefershTokenStorage interface (see https://github.com/softwaremill/akka-http-session#refresh-tokens-aka-remember-me). However note that this is only for remember-me - so re-creating sessions (auto-login/remember-me).

Otherwise sessions are cookie or header-based, and there are no DB lookups when accessing a session. However, it would be quite trivial to combine the session directive with a lookup in the database, verifying that the any kind of data stored in the session is valid.

Thank you