TsgcWSAPIServer_WebAuthnEvents › OnWebAuthnAuthenticationError

OnWebAuthnAuthenticationError Event

Fires when /authenticate/verify rejects the assertion; exposes the failing request and the textual reason so the application can log or alert on it.

Syntax

property OnWebAuthnAuthenticationError: TsgcWebAuthnOnAuthenticationError;
// TsgcWebAuthnOnAuthenticationError = procedure(Sender: TObject; const aRequest: TsgcWebAuthn_AuthenticationVerify_Request; const aError: string) of object

Default Value

Remarks

Raised when assertion verification fails for any reason — unknown credential id, invalid signature, challenge/origin mismatch, sign counter regression, user verification required but not provided, etc. aRequest carries the client payload and aError a human-readable description. Use it to write audit records, to increment a failed-login counter for brute-force protection, or to surface a localised error to the client.

Example

procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnAuthenticationError(Sender: TObject;
  const aRequest: TsgcWebAuthn_AuthenticationVerify_Request; const aError: string);
begin
  Memo1.Lines.Add('Authentication failed: ' + aError);
end;

Back to Events