Fix bug PublicKeyCredentialUserEntityRepository saves anonymousUser
Issue gh-16385 Signed-off-by: Borghi <137845283+Borghii@users.noreply.github.com>
This commit is contained in:
@@ -536,6 +536,18 @@ class Webauthn4jRelyingPartyOperationsTests {
|
||||
.isEqualTo(creationOptions.getAuthenticatorSelection().getUserVerification());
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldReturnEmptyCredentialsWhenUserIsAnonymous() {
|
||||
AnonymousAuthenticationToken authentication = new AnonymousAuthenticationToken("key", "anonymousUser",
|
||||
Set.of(() -> "ROLE_ANONYMOUS"));
|
||||
PublicKeyCredentialRequestOptionsRequest createRequest = new ImmutablePublicKeyCredentialRequestOptionsRequest(
|
||||
authentication);
|
||||
PublicKeyCredentialRequestOptions credentialRequestOptions = this.rpOperations
|
||||
.createCredentialRequestOptions(createRequest);
|
||||
|
||||
assertThat(credentialRequestOptions.getAllowCredentials()).isEmpty();
|
||||
}
|
||||
|
||||
private static AuthenticatorAttestationResponse setFlag(byte... flags) throws Exception {
|
||||
AuthenticatorAttestationResponseBuilder authAttResponseBldr = TestAuthenticatorAttestationResponse
|
||||
.createAuthenticatorAttestationResponse();
|
||||
|
||||
Reference in New Issue
Block a user