Class MicrosoftIdentityPlatformAuthenticationHandler

Namespace
Cratis.Arc.Identity
Assembly
Cratis.Arc.Core.dll

Represents an IAuthenticationHandler for handling authentication in the context of Microsoft Identity Platform.

public class MicrosoftIdentityPlatformAuthenticationHandler : IAuthenticationHandler
Inheritance
MicrosoftIdentityPlatformAuthenticationHandler
Implements
Inherited Members
Extension Methods

Remarks

The forwarded identity headers are not signed. The handler ignores them, and the request stays anonymous, unless TrustForwardedIdentityHeaders is enabled because the host runs behind a trusted ingress.

Constructors

MicrosoftIdentityPlatformAuthenticationHandler(IOptions<ArcOptions>, ILoggerFactory)

Represents an IAuthenticationHandler for handling authentication in the context of Microsoft Identity Platform.

public MicrosoftIdentityPlatformAuthenticationHandler(IOptions<ArcOptions> options, ILoggerFactory loggerFactory)

Parameters

options IOptions<ArcOptions>

The ArcOptions.

loggerFactory ILoggerFactory

The ILoggerFactory.

Remarks

The forwarded identity headers are not signed. The handler ignores them, and the request stays anonymous, unless TrustForwardedIdentityHeaders is enabled because the host runs behind a trusted ingress.

Methods

HandleAuthentication(IHttpRequestContext)

Authenticates the request.

public 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.