Method AuthenticateAsync
- Namespace
- MailFathom.Infrastructure.Security.ApiKeys
- Assembly
- MailFathom.Infrastructure.dll
AuthenticateAsync(IReadOnlyList<ConfiguredSecret>, string?, CancellationToken)
Judges the credential an Authorization header carried.
public Task<ApiKeyAuthenticationResult> AuthenticateAsync(IReadOnlyList<ConfiguredSecret> configuredKeys, string? authorizationHeaderValue, CancellationToken cancellationToken)
Parameters
configuredKeysIReadOnlyList<ConfiguredSecret>The API keys the deployment configured, in configuration order.
authorizationHeaderValuestringThe raw header value, or null when the request carried none.
cancellationTokenCancellationTokenCancels the retrieval of the configured key material.
Returns
- Task<ApiKeyAuthenticationResult>
The name of the key that matched, or the reason the credential was refused.
Remarks
Neither the returned result nor anything logged on the way to it carries the presented credential, a configured reference, or key material.
Exceptions
- ArgumentNullException
Thrown when
configuredKeysis null.