Table of Contents

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

configuredKeys IReadOnlyList<ConfiguredSecret>

The API keys the deployment configured, in configuration order.

authorizationHeaderValue string

The raw header value, or null when the request carried none.

cancellationToken CancellationToken

Cancels 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 configuredKeys is null.