Interface IAuthenticationHandler

Namespace
Cratis.Arc.Authentication
Assembly
Cratis.Arc.Core.dll

Defines a handler for authenticating HTTP requests.

public interface IAuthenticationHandler
Extension Methods

Methods

HandleAuthentication(IHttpRequestContext)

Authenticates the request.

Task<AuthenticationResult> HandleAuthentication(IHttpRequestContext context)

Parameters

context IHttpRequestContext

The HTTP request context.

Returns

Task<AuthenticationResult>

The result of the authentication attempt.

Remarks

The endpoint's EndpointMetadata is already set on context when this method runs, so a handler can check AllowsAnonymous(IHttpRequestContext) before doing any work. On an endpoint that allows anonymous access, a missing or invalid credential is not an error: a handler that would otherwise reject the request - and in particular one that logs a rejection - should return Anonymous instead of Failed(AuthenticationFailureReason) in that case.