Method CreateAsync
- Namespace
- MailFathom.Application.Access.Credentials
- Assembly
- MailFathom.Application.dll
CreateAsync(Guid, UserId, UserCredentialMethod, UserCredentialLookup, string?, IReadOnlyList<MailFathomPermission>?, UserCredentialReach, CancellationToken)
Provisions a new credential for one user.
Task<UserCredentialWriteOutcome> CreateAsync(Guid credentialId, UserId user, UserCredentialMethod method, UserCredentialLookup lookup, string? material, IReadOnlyList<MailFathomPermission>? permissions, UserCredentialReach reach, CancellationToken cancellationToken)
Parameters
credentialIdGuidThe identifier the new credential is to carry.
userUserIdThe user the credential authenticates.
methodUserCredentialMethodHow the credential will be presented.
lookupUserCredentialLookupThe value it is resolved by.
materialstringThe stored representation of what is judged, or null for a method that keeps none.
permissionsIReadOnlyList<MailFathomPermission>The names the credential narrows its user's grant to, or null where it names none and holds what its user holds.
reachUserCredentialReachOn which endpoints, and from which networks, the credential may be presented.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<UserCredentialWriteOutcome>
What the act did, or why it did nothing.
Exceptions
- ArgumentNullException
Thrown when
reachis null.- ArgumentException
Thrown when
usernames nobody,methodorlookupis the unspecified struct default,credentialIdis the empty identifier,materialdisagrees with whatmethodstores, orreachnames no surface.