TsgcWSAPIServer_WebAuthn › Eventi › OnWebAuthnHTTPRequest
Si attiva prima che un endpoint WebAuthn elabori una richiesta HTTP in entrata; consente all'applicazione di esaminare le intestazioni, applicare limiti di frequenza o rifiutare la chiamata.
property OnWebAuthnHTTPRequest: TsgcWebAuthnOnHTTPRequest;
// TsgcWebAuthnOnHTTPRequest = procedure(Sender: TObject; aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest; var Accept: Boolean) of object
—
Viene chiamato una volta per ogni hit HTTP a qualsiasi endpoint WebAuthn. aMethod identifica quale endpoint è stato individuato (opzioni/verifica di registrazione o opzioni/verifica di autenticazione), aRequest espone gli header HTTP grezzi e il payload e Accept ha come valore predefinito true. Imposti Accept a false per interrompere la pipeline (ad esempio quando si limitano i client o si applicano allowlist di IP) — il server salterà quindi la logica WebAuthn per quella chiamata.
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;