TsgcWSAPIServer_WebAuthn › Events › OnWebAuthnRegistrationSuccessful
Fires at the end of /register/verify when attestation has been accepted; this is where the application must persist the new credential record for the user.
property OnWebAuthnRegistrationSuccessful: TsgcWebAuthnOnRegistrationSuccessful;
// TsgcWebAuthnOnRegistrationSuccessful = procedure(Sender: TObject; const aRegistration: TsgcWebAuthn_Registration; const aCredentialRecord: TsgcWebAuthn_CredentialRecord; var Accept: Boolean) of object
—
Final hook of a successful registration ceremony. aRegistration holds the original user information and the verified attestation; aCredentialRecord contains the server-side credential (credential id, public key, sign count, transports, backup flags, AAGUID) that must be stored keyed by user. Set Accept to false to abort the ceremony at the last moment — for example when your store rejected the insert — which causes the server to return an error to the client instead of a success response.
procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnRegistrationSuccessful(
Sender: TObject; const aRegistration: TsgcWebAuthn_Registration;
const aCredentialRecord: TsgcWebAuthn_CredentialRecord; var Accept: Boolean);
begin
Accept := SaveCredential(aRegistration.User.Name, aCredentialRecord);
end;