TsgcWSAPIServer_WebAuthn이벤트 › OnWebAuthnAuthenticationOptionsRequest

OnWebAuthnAuthenticationOptionsRequest 이벤트

/authenticate/begin 시작 시 발생합니다. 애플리케이션은 서버가 PublicKeyCredentialRequestOptions를 빌드할 수 있도록 사용자에게 등록된 자격 증명 목록을 반환해야 합니다.

구문

property OnWebAuthnAuthenticationOptionsRequest: TsgcWebAuthnOnAuthenticationOptionsRequest;
// TsgcWebAuthnOnAuthenticationOptionsRequest = procedure(Sender: TObject; const aRequest: TsgcWebAuthn_AuthenticationOptions_Request; var CredentialRecords: TsgcWebAuthn_CredentialRecords; var Accept: Boolean) of object

기본값

설명

인증 절차의 첫 번째 후크(WebAuthn navigator.credentials.get()). aRequest에는 클라이언트가 제공한 사용자 이름(또는 discoverable-credential 흐름의 경우 비어 있음)이 포함됩니다. 핸들러는 사용자에 대해 이전에 저장된 자격 증명으로 CredentialRecords를 채워야 합니다. 서버는 이를 사용하여 allowCredentials 목록을 작성하고, 검증 중에 공개 키를 조회하며, transport 힌트를 적용합니다. 절차를 거부하려면(예: 사용자가 잠겨 있거나 알 수 없는 경우) Accept를 false로 설정하십시오.

예제

procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnAuthenticationOptionsRequest(
  Sender: TObject; const aRequest: TsgcWebAuthn_AuthenticationOptions_Request;
  var CredentialRecords: TsgcWebAuthn_CredentialRecords; var Accept: Boolean);
begin
  CredentialRecords := LoadUserCredentials(aRequest.User.Name);
  Accept := Length(CredentialRecords) > 0;
end;

이벤트로 돌아가기