TsgcWSAPIServer_WebAuthnイベント › OnWebAuthnHTTPRequest

OnWebAuthnHTTPRequest イベント

WebAuthn エンドポイントが受信 HTTP リクエストを処理する前に発生します。アプリケーションがヘッダーを検査したり、レート制限を適用したり、呼び出しを拒否したりできます。

構文

property OnWebAuthnHTTPRequest: TsgcWebAuthnOnHTTPRequest;
// TsgcWebAuthnOnHTTPRequest = procedure(Sender: TObject; aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest; var Accept: Boolean) of object

デフォルト値

解説

WebAuthn エンドポイントへの HTTP アクセスごとに1回呼び出されます。aMethod は一致したエンドポイント(登録オプション/確認または認証オプション/確認)を識別し、aRequest は生の HTTP ヘッダーとペイロードを公開し、Accept はデフォルトで true です。パイプラインを短絡させるには(例えばクライアントのスロットリングや IP 許可リストの適用時)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;

イベントに戻る