Method CreateApiKey
CreateApiKey(string, string, IEnumerable<string>, DateTimeOffset?, ZedalCallContext)
Creates an API key for the calling account. The key is returned only here and can never be
retrieved again — store it as a secret. Requires scope usermgt.
Task<(string keyId, ApiKey apiKey)> CreateApiKey(string password, string description, IEnumerable<string> scopes, DateTimeOffset? expiresOn = null, ZedalCallContext context = default)
Parameters
passwordstringthe current password of the calling account. A key outlives the session, so creating one needs the password again. A wrong password fails with
InvalidArgument, the session stays valid.descriptionstringa name to recognize the key later.
scopesIEnumerable<string>every scope the key may grant, see ApiKeyScopes. An empty list creates a key without scopes, which only identifies the account.
expiresOnDateTimeOffset?optional expiry; without it the key does not expire.
contextZedalCallContextOptionale Deadline-/Cancellation-Steuerung; ohne Angabe gilt der Client-Default.