use of com.yubico.webauthn.data.PublicKeyCredentialRequestOptions.PublicKeyCredentialRequestOptionsBuilder in project java-webauthn-server by Yubico.
the class RelyingParty method startAssertion.
public AssertionRequest startAssertion(StartAssertionOptions startAssertionOptions) {
PublicKeyCredentialRequestOptionsBuilder pkcro = PublicKeyCredentialRequestOptions.builder().challenge(generateChallenge()).rpId(identity.getId()).allowCredentials(OptionalUtil.orElseOptional(startAssertionOptions.getUsername(), () -> startAssertionOptions.getUserHandle().flatMap(credentialRepository::getUsernameForUserHandle)).map(un -> new ArrayList<>(credentialRepository.getCredentialIdsForUsername(un)))).extensions(startAssertionOptions.getExtensions().merge(startAssertionOptions.getExtensions().toBuilder().appid(appId).build())).timeout(startAssertionOptions.getTimeout());
startAssertionOptions.getUserVerification().ifPresent(pkcro::userVerification);
return AssertionRequest.builder().publicKeyCredentialRequestOptions(pkcro.build()).username(startAssertionOptions.getUsername()).build();
}
Aggregations