TsgcWSAPIServer_WebAuthn › Events › OnWebAuthnRegistrationOptionsRequest
클라이언트가 PublicKeyCredentialCreationOptions를 요청할 때 /register/begin의 시작 부분에서 발생합니다. 애플리케이션이 사용자를 검증하고 의식(ceremony)을 승인하거나 거부할 수 있게 합니다.
property OnWebAuthnRegistrationOptionsRequest: TsgcWebAuthnOnRegistrationOptionsRequest;
// TsgcWebAuthnOnRegistrationOptionsRequest = procedure(Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request; var Accept: Boolean) of object
—
등록 의식의 첫 번째 후크(WebAuthn navigator.credentials.create()). aRequest에는 사용자 이름, 표시 이름 및 클라이언트가 제공한 기본 설정이 포함됩니다. Accept는 기본적으로 true입니다. 의식을 취소하려면 false로 설정하십시오(예: 사용자 이름이 이미 등록되어 있거나, 사용자가 더 많은 자격 증명을 등록할 수 없거나, 요청을 제한해야 하는 경우). 수락되면 서버는 챌린지를 생성하고 OnWebAuthnRegistrationOptionsResponse를 발생시킵니다.
procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnRegistrationOptionsRequest(
Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request;
var Accept: Boolean);
begin
if UserExists(aRequest.User.Name) then
Accept := False
else
Accept := True;
end;