TsgcWSAPIServer_WebAuthn › 이벤트 › OnWebAuthnAuthenticationGetCredential
어서션을 검증하는 동안 브라우저가 사용한 자격 증명이 세리머니(ceremony)의 자격 증명 목록에 없을 때 발생합니다(사용자 이름 없는 로그인 및 패스키 자동 완성). 애플리케이션은 자체 저장소에서 자격 증명 레코드를 반환합니다.
property OnWebAuthnAuthenticationGetCredential: TsgcWebAuthnOnAuthenticationGetCredential;
// TsgcWebAuthnOnAuthenticationGetCredential = procedure(Sender: TObject; const aCredentialId: String; const aCredentialRecord: TsgcWebAuthn_CredentialRecord; var Found: Boolean) of object
할당되지 않았습니다.
브라우저가 인증 세리머니에 응답하면, 서버는 세리머니의 자격 증명 레코드(즉 OnWebAuthnAuthenticationOptionsRequest이(가) 반환하거나 내부 목록에서 발견되는 레코드)에서 자격 증명을 찾습니다. 사용자 이름 없는 로그인이나 패스키 자동 완성에서는 이 목록이 보통 비어 있으므로, 서버는 브라우저가 전송한 자격 증명 id(aCredentialId, base64url)와 함께 이 이벤트를 발생시킵니다.
저장소에서 자격 증명을 조회하여 aCredentialRecord을(를) 채우고(예: ReadJSON과(와), AsJSON에서 가져와 OnWebAuthnRegistrationSuccessful에 저장한 JSON 사용) Found를 true로 설정하십시오. 레코드는 UserId(사용자 핸들)를 유지해야 하며, 이는 응답의 userHandle과(와) 비교됩니다. Found이(가) false이거나, 레코드의 CredentialId이(가) aCredentialId이(가) 아니거나, 세리머니가 사용자 이름으로 시작되었는데 레코드의 Username이(가) 다른 경우 로그인은 실패합니다. 이 이벤트 이후 어서션은 평소와 같이 레코드의 공개 키로 검증됩니다.
전체 저장 패턴은 Passkeys을(를) 참조하십시오.
procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnAuthenticationGetCredential(
Sender: TObject; const aCredentialId: String;
const aCredentialRecord: TsgcWebAuthn_CredentialRecord; var Found: Boolean);
var
vJSON: string;
begin
Found := DBFindPasskey(aCredentialId, vJSON);
if Found then
aCredentialRecord.ReadJSON(vJSON);
end;