-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
JdkSerializationRedisSerializer is not able to serialize Saml2LogoutRequest because of a lambda encoder #12472
Comments
Thanks, @tisch030, and my apologies for the trouble. This appears to be an oversight. Are you able to submit a PR that marks the |
Thanks for the reply and the confirmation that it was indeed an oversight and not necessarily a mistake on my part @jzheaux . I would really like to contribute (it would be my first ever PR for an open source project), but unfortunately I'm in the middle of my bachelor thesis and already a bit behind schedule. Marking an attribute as transient is not hard, but I wouldn't have the time to read through the contributor guidelines, set up gradle (I only have experience with maven) and write the appropriate test for serialization. That's why it would probably make the most sense for someone else to create a PR for it. I will keep my eyes on this and if the issue is still open in 4 weeks, I would most likely take it on myself and be very happy to provide a PR. Thank you again and happy new year everyone.
|
No problem, @tisch030. I'll leave the issue marked as |
@dkodippily yes, absolutely. |
Hi @jzheaux , can I raise a PR for this? |
Describe the bug
After upgrading from Spring Security 5.7 to 6.0, we noticed that the logout process initiated by the Saml2 relying party no longer works.
This is because the Saml2RelyingPartyInitiatedLogoutSuccessHandler tries to save the logout request in a HttpSessionLogoutRequestRepository. The HttpSessionLogoutRequestRepository tries to save the logout request inside the session.
Our session is managed by redis and the JdkSerializationRedisSerializer is responsable for serializing the deserializing the objects.
But because the Saml2LogoutRequest contains a lambda as the default encoder, the JdkSerializationRedisSerializer is not able to serialize the Saml2LogoutRequest object and does not save the logout request. Upon receving the saml2 logout response from the IDP, no session can be found which contains the logout request and we get an HTTP Status 400 – Bad Request.
Using the Jackson2Json Jackson2JsonRedisSerializer does not work, because the Saml2LogoutRequest does not have any public constructors, only a builder.
Seems like the change with the encoder came attribute with version 5.8 and has not been adressed so far, even though it seems like a general bug that should affect many others. I dont see a simple way how to workaround and would appreciate some help.
Expected behavior
The encoder attribute should not lead to a NotSerializableException if redis and JdkSerializationRedisSerializer is used for the management of sessions.
The text was updated successfully, but these errors were encountered: