TsgcWSAPIServer_WebAuthn › 이벤트 › OnWebAuthnAuthenticationSuccessful
어설션 서명이 유효할 때 /authenticate/verify가 끝날 때 발생합니다. 애플리케이션은 서명 카운터를 업데이트하고 세션을 설정해야 합니다.
property OnWebAuthnAuthenticationSuccessful: TsgcWebAuthnOnAuthenticationSuccessful;
// TsgcWebAuthnOnAuthenticationSuccessful = procedure(Sender: TObject; const aRequest: TsgcWebAuthn_AuthenticationVerify_Request; const aAuthentication: TsgcWebAuthn_Authentication; var Accept: Boolean) of object
—
성공적인 인증 ceremony의 최종 후크. aRequest는 클라이언트가 보낸 verify 페이로드이고, aAuthentication은 검증된 사용자 id, 일치하는 자격 증명 레코드 및 인증자가 보고한 새 서명 카운터를 전달합니다. 업데이트된 서명 카운터와 모든 backup/usage 플래그를 유지한 다음, 서버가 세션 토큰을 발급하도록 Accept를 true로 설정하십시오. 마지막 순간에 중단하려면 — 예를 들어 위험 엔진이 로그인을 거부할 때 — Accept를 false로 설정하십시오. 이 경우 클라이언트는 성공 응답 대신 인증 오류를 받습니다.
procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnAuthenticationSuccessful(
Sender: TObject; const aRequest: TsgcWebAuthn_AuthenticationVerify_Request;
const aAuthentication: TsgcWebAuthn_Authentication; var Accept: Boolean);
begin
UpdateSignCounter(aAuthentication.CredentialId, aAuthentication.SignCount);
Accept := True;
end;