사용자가 로그인을 시도하면 브라우저는 서버에 인증 옵션("assertion options"라고도 함)을 요청하는 요청을 보냅니다.
{
"username": "alice@example.com"
}
이 요청을 통해 서버는 다음을 수행할 수 있습니다:
WebAuthn Server Component가 이 요청을 수신하면(일반적으로 브라우저에서 서버 엔드포인트로의 HTTPS POST 요청을 통해 수행됨, 예: /sgcWebAuthn/Authentication/Options), OnWebAuthnAuthenticationOptionsRequest 이벤트가 호출되므로, 사용자 이름과 연결된 자격 증명(있는 경우)을 추가할 수 있습니다.
procedure OnWebAuthnAuthenticationOptionsRequest(
Sender: TObject; const aRequest:
TsgcWebAuthn_AuthenticationOptions_Request; var CredentialRecords:
TsgcWebAuthn_CredentialRecords; var Accept: Boolean);
begin
if UserExistsInDB(aRequest.Username) then
begin
While not EOF do
begin
CredentialRecords.AddCredentialRecordFromJSON(RecordFromDB);
Next;
end;
end;
end;