Hello all,
I've inherited a Grape JSON / API only app with a partial, home-made authentication. Given the comprehensiveness and quality of Rodauth, I thought I would convert my app. There is one thing I have not understood. How do I forcibly expire a user session?
Use case:
1) User logs in (JWT only, so he gets back a jwt)
2) App stores JWT to provide on subsequent requests
3) User loses his phone (which has the logged-in client app with the stored jwt)
4) Block that session (log in to admin panel, see list of sessions, clear the relevant session). <- How do I do that?
As far as I could see playing around, when using jwt only, there is no "session" stored server side. For as long as the token is valid, somebody could steal the jwt and use it, even after the user logs out. On the other hand, this mechanism is there for html. Am I missing something?
In my context, I need long sessions (the user may lose connectivity for long periods), and also wanted to expire the session when the user logs out as the app is sensitive.
The way my current app was doing it was generating a jwt authorization token, however storing it server side and treating it like a session cookie (in addition to having a refresh token).
Thanks
André