TsgcWSAPIServer_WebAuthnEvents › OnWebAuthnHTTPResponse

OnWebAuthnHTTPResponse Event

Fires after the server has built the HTTP response for a WebAuthn endpoint but before it is sent; useful to audit or decorate the outgoing payload and headers.

Syntax

property OnWebAuthnHTTPResponse: TsgcWebAuthnOnHTTPResponse;
// TsgcWebAuthnOnHTTPResponse = procedure(Sender: TObject; aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest; const aResponse: TsgcHTTPResponse) of object

Default Value

Remarks

Companion to OnWebAuthnHTTPRequest. Fires just before the response leaves the server with the final aResponse (status code, headers and body) paired with the original aRequest and the aMethod that identifies the endpoint. Typical uses are access logging, metrics, adding custom security headers or writing the response to an audit trail.

Example

procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnHTTPResponse(Sender: TObject;
  aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest;
  const aResponse: TsgcHTTPResponse);
begin
  Memo1.Lines.Add(Format('WebAuthn %d %s', [aResponse.ResponseCode, aRequest.URI]));
end;

Back to Events