Method ProvisionPublicKeyAsync
- Namespace
- MailFathom.Application.Access.Credentials
- Assembly
- MailFathom.Application.dll
ProvisionPublicKeyAsync(UserId, string?, IReadOnlyList<MailFathomPermission>?, UserCredentialReach, CancellationToken)
Registers a public key whose signed assertions authenticate one user.
public Task<UserCredentialProvisioning> ProvisionPublicKeyAsync(UserId user, string? writtenPublicKey, IReadOnlyList<MailFathomPermission>? permissions, UserCredentialReach reach, CancellationToken cancellationToken)
Parameters
userUserIdThe user the credential authenticates.
writtenPublicKeystringThe client's public key as the operator supplied it.
permissionsIReadOnlyList<MailFathomPermission>The names the credential narrows its user's grant to, or null to name none and hold what the user holds.
reachUserCredentialReachOn which endpoints, and from which networks, the credential may be presented.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<UserCredentialProvisioning>
What the act did, and the fingerprint the client's assertions must name.
Exceptions
- ArgumentException
Thrown when
usernames nobody, the written key is not one this deployment accepts, or the grant names something a user-facing credential cannot hold.- PrincipalNotAuthorizedException
Thrown when the caller holds AdminCredentialsWrite at no scope, does not hold a name the user holds widely enough, or is not the root while the user holds a role listing a pattern.