|
|
|
|
@ -191,6 +191,12 @@ import org.springframework.security.web.csrf.MissingCsrfTokenException;
@@ -191,6 +191,12 @@ import org.springframework.security.web.csrf.MissingCsrfTokenException;
|
|
|
|
|
import org.springframework.security.web.firewall.RequestRejectedException; |
|
|
|
|
import org.springframework.security.web.server.firewall.ServerExchangeRejectedException; |
|
|
|
|
import org.springframework.security.web.session.HttpSessionCreatedEvent; |
|
|
|
|
import org.springframework.security.web.webauthn.api.Bytes; |
|
|
|
|
import org.springframework.security.web.webauthn.api.ImmutablePublicKeyCredentialUserEntity; |
|
|
|
|
import org.springframework.security.web.webauthn.api.PublicKeyCredentialUserEntity; |
|
|
|
|
import org.springframework.security.web.webauthn.api.TestBytes; |
|
|
|
|
import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialUserEntity; |
|
|
|
|
import org.springframework.security.web.webauthn.authentication.WebAuthnAuthentication; |
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
import static org.assertj.core.api.Assertions.fail; |
|
|
|
|
@ -508,6 +514,20 @@ class SpringSecurityCoreVersionSerializableTests {
@@ -508,6 +514,20 @@ class SpringSecurityCoreVersionSerializableTests {
|
|
|
|
|
(r) -> new AuthenticationSwitchUserEvent(authentication, user)); |
|
|
|
|
generatorByClassName.put(HttpSessionCreatedEvent.class, |
|
|
|
|
(r) -> new HttpSessionCreatedEvent(new MockHttpSession())); |
|
|
|
|
|
|
|
|
|
// webauthn
|
|
|
|
|
generatorByClassName.put(Bytes.class, (r) -> TestBytes.get()); |
|
|
|
|
generatorByClassName.put(ImmutablePublicKeyCredentialUserEntity.class, |
|
|
|
|
(r) -> TestPublicKeyCredentialUserEntity.userEntity().id(TestBytes.get()).build()); |
|
|
|
|
generatorByClassName.put(WebAuthnAuthentication.class, (r) -> { |
|
|
|
|
PublicKeyCredentialUserEntity userEntity = TestPublicKeyCredentialUserEntity.userEntity() |
|
|
|
|
.id(TestBytes.get()) |
|
|
|
|
.build(); |
|
|
|
|
List<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList("ROLE_USER"); |
|
|
|
|
WebAuthnAuthentication webAuthnAuthentication = new WebAuthnAuthentication(userEntity, authorities); |
|
|
|
|
webAuthnAuthentication.setDetails(details); |
|
|
|
|
return webAuthnAuthentication; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
|
|