-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After invalidateSession I'm able to access secured endpoint with "invalidated" session #35
Comments
If you are using the header transport, then invalidating the session responds with an empty Note that except for refreshable sessions, akka-http-session is stateless - it doesn't store the sessions anywhere, so the library itself has no way of knowing if the token was previously invalidated or not. |
@adamw thanks for the explanation. So this happens due that fact that in akka-http-session a session is a stateless and once it is generated I can use it until its identifier is deleted locally on a client side (browser, mobile device) Correct? |
Yes. That's why sessions should always have an expiry date :) Optionally refreshed with the refresh token - which assumes external storage and "global" invalidation. |
I'll keep this open to clarify the docs later :) |
@adamw deal :) |
Hi all, got same problem regarding invalidation. I use InMemoryRefreshTokenStorage[T] and it stores session data well during app lifecycle. I use header transport as well and invalidating the session response with an empty
it should remove session from storage, especially with Could you clarify if everything should work as @adamw described, why this method is here and what for? Please assume my code is similar to @Fruzenshtein implementation, expanded only by InMemoryRefreshTokenStorage[T], there is no something special. Thank you for helping. PS tested with scalatest and curl |
@kormoglaz so you are saying that the token is not removed from storage? That should happen ... maybe you can try with a copy of Btw. this storage isn't mean for production, only for testing. It's not thread-safe (but making it such wouldn't be hard, just a different |
Hello
Looks like the invalidateSession function doesn't invalidate the session as it should. I'll explain below what I mean. If you want to look at steps to reproduce without technical details, scroll to the end :)
I use "com.softwaremill.akka-http-session" %% "core" % "0.4.0" with Scala version 2.12.1
I use following configs for session:
Here is my session serialization (de-)
And finally routes:
Here is what I do:
So the question:
Why I can still successfully can use the token after invalidation?
Thanks
The text was updated successfully, but these errors were encountered: