Method FindAsync
- Namespace
- MailFathom.Application.Access.Credentials
- Assembly
- MailFathom.Application.dll
FindAsync(UserCredentialMethod, UserCredentialLookup, CancellationToken)
Resolves the one credential a method and a lookup name, whether or not it is enabled.
Task<ResolvedUserCredential?> FindAsync(UserCredentialMethod method, UserCredentialLookup lookup, CancellationToken cancellationToken)
Parameters
methodUserCredentialMethodHow the credential was presented.
lookupUserCredentialLookupThe value the presented credential resolves by.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<ResolvedUserCredential>
The credential, or null when no row carries that lookup for that method.
Remarks
One indexed read of the method and the canonical lookup together. A disabled credential is returned rather than filtered away, so the caller spends the same work on every outcome and the refusal it composes cannot be timed apart from the refusal an unknown lookup produces. Only a credential scoped to no organization is resolved here, which is every credential of the methods whose lookups are unique across the deployment; a password is resolved by the login it is typed as through FindPasswordAsync(UserCredentialLogin, CancellationToken).
Exceptions
- ArgumentException
Thrown when
methodorlookupis the unspecified struct default.