TsgcWSAPIServer_WebAuthn › Events › OnWebAuthnRegistrationOptionsResponse
Fires after the server has built the PublicKeyCredentialCreationOptions response for /register/begin; lets the application inspect or persist the generated challenge.
property OnWebAuthnRegistrationOptionsResponse: TsgcWebAuthnOnRegistrationOptionsResponse;
// TsgcWebAuthnOnRegistrationOptionsResponse = procedure(Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request; const aResponse: TsgcWebAuthn_RegistrationOptions_Response) of object
—
Companion to OnWebAuthnRegistrationOptionsRequest. Fires after the server has built the full PublicKeyCredentialCreationOptions payload (challenge, RP, user id, excludeCredentials, pubKeyCredParams, attestation, authenticator selection). Use it to persist the challenge to a shared store in clustered deployments, to audit the emitted options or to enrich the response with application-specific telemetry before it is serialized to the client.
procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnRegistrationOptionsResponse(
Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request;
const aResponse: TsgcWebAuthn_RegistrationOptions_Response);
begin
SaveChallenge(aRequest.User.Name, aResponse.Challenge);
end;