이 등록 옵션 요청은 WebAuthn 등록을 안전하게 부트스트랩하는 데 필수적입니다. 이 요청은 서버에 다음을 요청합니다:
브라우저는 보안 WebAuthn 자격 증명 등록을 시작하기 위해 서버로부터 자격 증명 생성 옵션을 얻어야 합니다. 이는 일반적으로 브라우저에서 서버 엔드포인트(예: /sgcWebAuthn/Registration/Options)로의 HTTPS POST 요청을 통해 수행되며, challenge, RP ID 및 사용자 정보와 같은 매개변수를 준비합니다.
요청 본문에는 사용자를 식별하고 가능하면 구성 기본 설정을 제공하는 데이터가 포함됩니다. 종종 다음과 같이 보입니다:
{
"username": "alice@example.com",
"displayName": "Alice Smith",
"authenticatorSelection": {
"authenticatorAttachment": "platform", // optional: platform or cross-platform
"userVerification": "preferred" // optional: required | preferred | discouraged
},
"attestation": "none", // or "direct", "indirect"
"residentKey": "discouraged" // optional
}
WebAuthn Server 구성 요소는 EndpointOptions.RegistrationOptions 속성에 구성된 엔드포인트에서 PublicKeyCredentialCreationOptions를 얻기 위한 초기 브라우저 요청을 수신 대기합니다. 서버가 새 HTTP Request를 수신하면 OnWebAuthnRegistrationOptionsRequest 이벤트가 호출되며, 클라이언트가 보낸 요청에 액세스하고 Accept 매개변수를 False로 설정하여 요청을 취소할 수 있습니다.
procedure OnWebAuthnRegistrationOptionsRequest(Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request; var Accept: Boolean);
begin
if aRequest.Username = 'anonymous' then
Accept := False;
end;