Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
UserVerificationRequirement registration and AuthN both preferred
Browse files Browse the repository at this point in the history
  • Loading branch information
rwinch committed May 9, 2024
1 parent 0ff9161 commit 69d24e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public PublicKeyCredentialRequestOptions createCredentialRequestOptions(Authenti
.challenge(Base64Url.random())
.rpId(this.rp.getId())
.timeout(Duration.ofMinutes(5))
.userVerification(UserVerificationRequirement.REQUIRED)
.userVerification(UserVerificationRequirement.PREFERRED)
.customize(this.customizeRequestOptions)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ void registerCredentialWhenFmtNotValid() throws Exception {
// assertThatThrownBy(() -> this.rpOperations.registerCredential(registrationRequest)).hasMessageContaining("Flag combination is invalid");
}

@Test
void createCredentialRequestOptionsThenUserVerificationSameAsCreation() {
PublicKeyCredentialCreationOptions creationOptions = this.rpOperations.createPublicKeyCredentialCreationOptions(this.user);
PublicKeyCredentialRequestOptions credentialRequestOptions = this.rpOperations.createCredentialRequestOptions(this.user);
assertThat(credentialRequestOptions.getUserVerification()).isEqualTo(creationOptions.getAuthenticatorSelection().getUserVerification());
}

private static AuthenticatorAttestationResponse setFlag(byte... flags) throws Exception {
AuthenticatorAttestationResponseBuilder authAttResponseBldr = TestAuthenticatorAttestationResponse.createAuthenticatorAttestationResponse();
byte[] originalAttestationObjBytes = authAttResponseBldr.build().getAttestationObject().getBytes();
Expand Down

0 comments on commit 69d24e6

Please sign in to comment.