Table of Contents

Class ForceOpenIdMiddleWare

Namespace
Arc4u.OAuth2.Middleware
Assembly
Arc4u.OAuth2.AspNetCore.dll

A middleware that challenges the OpenID Connect scheme for unauthenticated requests whose path matches one of the ForceAuthenticationForPaths. It is meant for the parts of a site used from a browser (Swagger, Hangfire, ...) where the user must be sent to the login page.

public class ForceOpenIdMiddleWare
Inheritance
ForceOpenIdMiddleWare
Inherited Members

Constructors

ForceOpenIdMiddleWare(RequestDelegate, IOptions<ForceOpenIdMiddleWareOptions>)

Initializes a new instance of the ForceOpenIdMiddleWare class.

public ForceOpenIdMiddleWare(RequestDelegate next, IOptions<ForceOpenIdMiddleWareOptions> options)

Parameters

next RequestDelegate

The next middleware of the pipeline.

options IOptions<ForceOpenIdMiddleWareOptions>

The options listing the paths.

Exceptions

ArgumentNullException

An argument is null.

Methods

InvokeAsync(HttpContext, ILogger<ForceOpenIdMiddleWare>)

Processes the request.

public Task InvokeAsync(HttpContext context, ILogger<ForceOpenIdMiddleWare> logger)

Parameters

context HttpContext

The HTTP context.

logger ILogger<ForceOpenIdMiddleWare>

The logger.

Returns

Task

A task that completes when the request is challenged or the rest of the pipeline is done.