-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Saml2AuthenticationRequestRepository does not work in combination with Spring Session #10828
Comments
Thanks for reaching out @tompson. Note that we have a workaround shared in spring-projects/spring-session#1577. We will need to think about what changes in Spring Security or Spring Session could make this scenario work, since there is no clear solution at the moment. |
@tompson, can you clarify how this is an issue with
|
@eleftherias thanks for that hint, I experimented with different settings for @jzheaux I stumbled across this when trying to solve #10550 and I realised later that it is just an optional validation of |
Thanks, @tompson. I wonder if you could create an implementation of Since there is no problem with |
@jzheaux: Can you connect the dots for me a bit on this? Is the premise that one would write one's own implementation of |
Summary
The
HttpSessionSaml2AuthenticationRequestRepository
saves theSaml2AuthenticationRequest
in the session and tries to load it after the IdP authenticated the user.This does not work when using Spring Session because the session cookie is not sent to the server after the IdP authenticated the user.
Spring Session creates a session cookie with
SameSite=Lax
which causes the browser not to send the cookie when sending thePOST
request after the IdP authentication.To Reproduce
Create a minimal Spring Boot application with Spring Security SAML and Spring Session active.
Expected behaviour
After login at the IdP and being redirected to the application the user should be signed in and seeing the secured URL.
Actual behaviour
A new session is created and the user is at the login page again. When he tries to load the secured URL he is able to request it.
The text was updated successfully, but these errors were encountered: