TsgcWSAPIKeyManager › Properties › Expiration
Default TTL, enforcement flag and background sweep interval controlling how issued keys age out.
property Expiration: TsgcAPIKeyExpiration read FExpiration write SetExpiration;
—
Controls how issued keys age out. DefaultTTLSec is applied by IssueKey when the caller passes aExpiresInSec = 0; set it to enforce a blanket policy (for example 90 days for partner keys). EnforceExpiry toggles whether ValidateKey rejects keys whose ExpiresAt is in the past — leave it True in production. CheckIntervalSec controls how often the background sweep scans for newly expired entries, fires OnKeyExpired (or the earlier NotifyBeforeExpirySec warning) and updates Stats. Set DefaultTTLSec to 0 when keys should never expire by default.
// Partner keys expire after 90 days, enforced strictly, swept every minute
sgcWSAPIKeyManager1.Expiration.DefaultTTLSec := 90 * 86400;
sgcWSAPIKeyManager1.Expiration.EnforceExpiry := True;
sgcWSAPIKeyManager1.Expiration.CheckIntervalSec := 60;