서버는 클라이언트의 등록 옵션 요청(예: POST /sgcWebAuthn/Registration/Options)에 다음과 같은 JSON 페이로드로 응답합니다(바이너리 필드를 base64url로 인코딩한 후):
{
"publicKey": {
"rp": {
"name": "esegece software",
"id": "esegece.com"
},
"user": {
"id": "c3ViamVjdC1pZA", // base64url-encoded ArrayBuffer (user handle)
"name": "webauthn@esegece.com",
"displayName": "Delphi Developer"
},
"challenge": "Xz8x2K6nY3gZ...", // base64url-encoded challenge
"pubKeyCredParams": [
{ "type": "public-key", "alg": -7 }, // ES256
{ "type": "public-key", "alg": -257 } // RS256
],
"timeout": 60000,
"attestation": "none",
"authenticatorSelection": {
"authenticatorAttachment": "platform",
"userVerification": "preferred",
"residentKey": "discouraged"
}
}
}
아래에서 필드에 대한 설명을 확인하십시오:
응답이 클라이언트로 전송되기 전에 OnWebAuthnRegistrationOptionsResponse 이벤트가 호출되어 응답을 사용자 정의할 수 있습니다.
procedure OnWebAuthnRegistrationOptionsResponse(Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request; const aResponse: TsgcWebAuthn_RegistrationOptions_Response);
begin
if aRequest.Username = 'esegece.com' then
begin
aResponse.ExcludeCredentials.AddCredentialRecordFromJSON('json1.txt');
aResponse.ExcludeCredentials.AddCredentialRecordFromJSON('json2.txt');
end;
end;