private void OnClickAuthentication(object sender, EventArgs e) { string Tag = "OnClickAuthentication"; if (!fido2Client.IsSupported) { log.Info(Tag, "FIDO2 is not supported."); return; } IFidoServer fidoServer = new FidoServerSimulator(); if (fidoServer == null) { log.Error(Tag, GetString(Resource.String.connect_server_err)); return; } ServerPublicKeyCredentialCreationOptionsRequest request = GetAuthnServerPublicKeyCredentialCreationOptionsRequest(); if (request == null) { return; } // Obtain the challenge value and related policy from the FIDO server, and initiate a Fido2AuthenticationRequest // request. ServerPublicKeyCredentialCreationOptionsResponse response = fidoServer.GetAssertionOptions(request); if (!ServerStatus.Ok.Equals(response.GetStatus())) { log.Error(Tag, GetString(Resource.String.authn_fail) + response.GetErrorMessage()); return; } string attachmentMode = GetSpinnerSelect(attachmentSp.SelectedItem); bool isUseSelectedPlatformAuthenticator = Attachment.Platform.Value.Equals(attachmentMode); PublicKeyCredentialRequestOptions publicKeyCredentialCreationOptions = ServerUtils.ConvertToPublicKeyCredentialRequestOptions(fido2Client, response, isUseSelectedPlatformAuthenticator); AuthenticateToFido2Client(publicKeyCredentialCreationOptions); }