mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-24 21:12:18 +00:00
Make Saml2AuthenticationToken Serializable
Issue gh-16286
This commit is contained in:
parent
bcc4b415b3
commit
5ff87128b1
@ -178,8 +178,10 @@ import org.springframework.security.saml2.credentials.TestSaml2X509Credentials;
|
|||||||
import org.springframework.security.saml2.provider.service.authentication.DefaultSaml2AuthenticatedPrincipal;
|
import org.springframework.security.saml2.provider.service.authentication.DefaultSaml2AuthenticatedPrincipal;
|
||||||
import org.springframework.security.saml2.provider.service.authentication.Saml2Authentication;
|
import org.springframework.security.saml2.provider.service.authentication.Saml2Authentication;
|
||||||
import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException;
|
import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException;
|
||||||
|
import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken;
|
||||||
import org.springframework.security.saml2.provider.service.authentication.Saml2PostAuthenticationRequest;
|
import org.springframework.security.saml2.provider.service.authentication.Saml2PostAuthenticationRequest;
|
||||||
import org.springframework.security.saml2.provider.service.authentication.Saml2RedirectAuthenticationRequest;
|
import org.springframework.security.saml2.provider.service.authentication.Saml2RedirectAuthenticationRequest;
|
||||||
|
import org.springframework.security.saml2.provider.service.authentication.TestSaml2AuthenticationTokens;
|
||||||
import org.springframework.security.saml2.provider.service.authentication.TestSaml2Authentications;
|
import org.springframework.security.saml2.provider.service.authentication.TestSaml2Authentications;
|
||||||
import org.springframework.security.saml2.provider.service.authentication.TestSaml2PostAuthenticationRequests;
|
import org.springframework.security.saml2.provider.service.authentication.TestSaml2PostAuthenticationRequests;
|
||||||
import org.springframework.security.saml2.provider.service.authentication.TestSaml2RedirectAuthenticationRequests;
|
import org.springframework.security.saml2.provider.service.authentication.TestSaml2RedirectAuthenticationRequests;
|
||||||
@ -500,6 +502,11 @@ class SpringSecurityCoreVersionSerializableTests {
|
|||||||
generatorByClassName.put(AssertingPartyDetails.class,
|
generatorByClassName.put(AssertingPartyDetails.class,
|
||||||
(r) -> TestRelyingPartyRegistrations.full().build().getAssertingPartyMetadata());
|
(r) -> TestRelyingPartyRegistrations.full().build().getAssertingPartyMetadata());
|
||||||
generatorByClassName.put(RelyingPartyRegistration.class, (r) -> TestRelyingPartyRegistrations.full().build());
|
generatorByClassName.put(RelyingPartyRegistration.class, (r) -> TestRelyingPartyRegistrations.full().build());
|
||||||
|
generatorByClassName.put(Saml2AuthenticationToken.class, (r) -> {
|
||||||
|
Saml2AuthenticationToken token = TestSaml2AuthenticationTokens.tokenRequested();
|
||||||
|
token.setDetails(details);
|
||||||
|
return token;
|
||||||
|
});
|
||||||
|
|
||||||
// web
|
// web
|
||||||
generatorByClassName.put(AnonymousAuthenticationToken.class, (r) -> {
|
generatorByClassName.put(AnonymousAuthenticationToken.class, (r) -> {
|
||||||
|
Binary file not shown.
@ -35,4 +35,11 @@ public final class TestSaml2AuthenticationTokens {
|
|||||||
return new Saml2AuthenticationToken(relyingPartyRegistration, "saml2-xml-response-object");
|
return new Saml2AuthenticationToken(relyingPartyRegistration, "saml2-xml-response-object");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Saml2AuthenticationToken tokenRequested() {
|
||||||
|
RelyingPartyRegistration relyingPartyRegistration = TestRelyingPartyRegistrations.relyingPartyRegistration()
|
||||||
|
.build();
|
||||||
|
return new Saml2AuthenticationToken(relyingPartyRegistration, "saml2-xml-response-object",
|
||||||
|
TestSaml2PostAuthenticationRequests.create());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user