TsgcWSAPIKeyManager › Events › OnKeyIssued
Fired when a new key has been issued; carries the owner, plaintext key and scopes.
property OnKeyIssued: TsgcAPIKeyOnKeyIssued;
// TsgcAPIKeyOnKeyIssued = procedure(Sender: TObject; const aOwner, aKey: string; const aScopes: TsgcAPIKeyScopes) of object
—
Fires synchronously at the end of IssueKey (and from inside RotateKey, which issues a replacement key). This is the last point at which the plaintext aKey can be observed — after the handler returns only the hash remains in storage. Use the event to drive secure delivery: email the customer, push into a one-time-view page, write into the admin's secrets vault. aOwner and aScopes mirror the arguments supplied to IssueKey. Do not store the plaintext yourself unless your delivery mechanism requires it.
procedure TForm1.sgcWSAPIKeyManager1KeyIssued(Sender: TObject;
const aOwner, aKey: string; const aScopes: TsgcAPIKeyScopes);
begin
// Deliver plaintext to the customer exactly once
SendOnboardingEmail(aOwner, aKey);
end;