Skip to content
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

Saml2Authentication isn't serializable #7681

Closed
clemstoquart opened this issue Nov 28, 2019 · 2 comments · Fixed by #7683
Closed

Saml2Authentication isn't serializable #7681

clemstoquart opened this issue Nov 28, 2019 · 2 comments · Fixed by #7683

Comments

@clemstoquart
Copy link
Contributor

@clemstoquart clemstoquart commented Nov 28, 2019

Hi Spring Security team,

I've encounter an issue using the new Saml2 support with Spring Session.

In the OpenSamlAuthenticationProvider class in the authenticate method we create the authentication this way :

new Saml2Authentication(
    () -> username, token.getSaml2Response(),
    this.authoritiesMapper.mapAuthorities(getAssertionAuthorities(assertion))
)

But this isn't serializable with the default serializer provided by Spring Session.

Solution

IMO provide an implementation of the AuthenticatedPrincipal instead of using an anonymous class should do the trick here.

What do you think about that ?

Have a nice day :)

@eleftherias

This comment has been minimized.

Copy link
Contributor

@eleftherias eleftherias commented Nov 28, 2019

@clemstoquart Thanks for the report and for the work you're doing with the new SAML2 support!
I can see the problem and I agree that creating a SAML2 implementation of AuthenticatedPrincipal is an appropriate solution.
Are you interested in submitting a PR for this fix?

@clemstoquart

This comment has been minimized.

Copy link
Contributor Author

@clemstoquart clemstoquart commented Nov 28, 2019

@eleftherias you're welcome :)

Yes I'm preparing a PR.

@eleftherias eleftherias added this to the 5.3.0.M1 milestone Dec 12, 2019
eleftherias added a commit that referenced this issue Dec 12, 2019
Update @SInCE

Issue: gh-7681
eleftherias added a commit that referenced this issue Dec 12, 2019
Update @SInCE

Issue: gh-7681
@eleftherias eleftherias modified the milestones: 5.3.0.M1, 5.2.2 Dec 12, 2019
@eleftherias eleftherias modified the milestones: 5.2.2, 5.3.0.M1 Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.