-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Saml2Authentication isn't serializable #7681
Copy link
Copy link
Closed
Labels
in: saml2An issue in SAML2 modulesAn issue in SAML2 modulesstatus: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
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 :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: saml2An issue in SAML2 modulesAn issue in SAML2 modulesstatus: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug