mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-23 12:32:13 +00:00
Polish Webauthn4JRelyingPartyOperations
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
parent
18010f9914
commit
709f5db0e5
@ -199,7 +199,7 @@ public class Webauthn4JRelyingPartyOperations implements WebAuthnRelyingPartyOpe
|
||||
}
|
||||
|
||||
private static List<PublicKeyCredentialDescriptor> credentialDescriptors(List<CredentialRecord> credentialRecords) {
|
||||
List result = new ArrayList();
|
||||
List<PublicKeyCredentialDescriptor> result = new ArrayList<>();
|
||||
for (CredentialRecord credentialRecord : credentialRecords) {
|
||||
Bytes id = Bytes.fromBase64(credentialRecord.getCredentialId().toBase64UrlString());
|
||||
PublicKeyCredentialDescriptor credentialDescriptor = PublicKeyCredentialDescriptor.builder()
|
||||
@ -372,9 +372,6 @@ public class Webauthn4JRelyingPartyOperations implements WebAuthnRelyingPartyOpe
|
||||
|
||||
Authenticator authenticator = new AuthenticatorImpl(data, attestationObject.getAttestationStatement(),
|
||||
credentialRecord.getSignatureCount());
|
||||
if (authenticator == null) {
|
||||
throw new IllegalStateException("No authenticator found");
|
||||
}
|
||||
Set<Origin> origins = toOrigins();
|
||||
Challenge challenge = new DefaultChallenge(requestOptions.getChallenge().getBytes());
|
||||
// FIXME: should populate this
|
||||
|
@ -138,7 +138,7 @@ class Webauthn4jRelyingPartyOperationsTests {
|
||||
@Test
|
||||
void createPublicKeyCredentialCreationOptionsWhenAnonymousThenIllegalArgumentException() {
|
||||
AnonymousAuthenticationToken anonymous = new AnonymousAuthenticationToken("key", "notAuthenticated",
|
||||
Set.of(() -> "ROLE_ANOYMOUS"));
|
||||
Set.of(() -> "ROLE_ANONYMOUS"));
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> this.rpOperations.createPublicKeyCredentialCreationOptions(
|
||||
new ImmutablePublicKeyCredentialCreationOptionsRequest(anonymous)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user