TsgcWSAPIServer_WebAuthn › 이벤트 › OnWebAuthnHTTPRequest
WebAuthn 엔드포인트가 들어오는 HTTP 요청을 처리하기 전에 발생합니다. 애플리케이션이 헤더를 검사하거나, 속도 제한을 적용하거나, 호출을 거부할 수 있게 합니다.
property OnWebAuthnHTTPRequest: TsgcWebAuthnOnHTTPRequest;
// TsgcWebAuthnOnHTTPRequest = procedure(Sender: TObject; aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest; var Accept: Boolean) of object
—
모든 WebAuthn 엔드포인트에 대한 HTTP 히트당 한 번 호출됩니다. aMethod는 어떤 엔드포인트가 일치되었는지 식별하고(registration options/verify 또는 authentication options/verify), aRequest는 원시 HTTP 헤더와 페이로드를 노출하며 Accept는 기본적으로 true입니다. 파이프라인을 단축하려면(예: 클라이언트를 스로틀링하거나 IP allowlist를 시행할 때) Accept를 false로 설정하십시오. 그러면 서버는 해당 호출에 대한 WebAuthn 로직을 건너뜁니다.
procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnHTTPRequest(Sender: TObject;
aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest;
var Accept: Boolean);
begin
Memo1.Lines.Add('WebAuthn request from ' + aRequest.RemoteIP);
if IsBlocked(aRequest.RemoteIP) then
Accept := False;
end;