TsgcWSAPIServer_WebAuthnEventi › OnWebAuthnHTTPResponse

OnWebAuthnHTTPResponse Evento

Viene generato dopo che il server ha costruito la risposta HTTP per un endpoint WebAuthn ma prima che venga inviata; utile per controllare o decorare il payload e le intestazioni in uscita.

Sintassi

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

Valore predefinito

Note

Complementare a OnWebAuthnHTTPRequest. Si attiva appena prima che la risposta lasci il server con la aResponse finale (codice di stato, intestazioni e corpo) abbinata alla aRequest originale e al aMethod che identifica l'endpoint. Gli usi tipici includono la registrazione degli accessi, le metriche, l'aggiunta di intestazioni di sicurezza personalizzate o la scrittura della risposta in un registro di controllo.

Esempio

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;

Torna agli Eventi