Table of Contents

Namespace Arc4u.OAuth2.Middleware

Classes

AddContextToPrincipalMiddleware

A middleware that enriches the request of an authenticated AppPrincipal: it ensures the request carries a traceparent header and sets the current culture of the principal profile from the culture request header.

AddContextToPrincipalMiddlewareExtension

Registers the AddContextToPrincipalMiddleware.

BasicAuthenticationMiddleware

A middleware that converts credentials into a bearer token. The credentials are read from a Basic Authorization header or, when the CertificateHeaderOptions are configured, from an encrypted header or query string parameter. A token is requested for them from the token provider designated by the ProviderId of the settings, cached in the ITokenCache, and the Authorization header of the request is replaced by Bearer <token>. Errors are logged and the request continues without change.

BasicAuthenticationMiddlewareExtension

Registers and configures the BasicAuthenticationMiddleware.

ForceOpenIdMiddleWare

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.

ForceOpenIdMiddleWareOptions

Configures the ForceOpenIdMiddleWare.

ForceOpenIdMiddleWareOptionsExtension

Registers and adds the ForceOpenIdMiddleWare.

OpenIdBearerInjectorMiddleware

A middleware that gives a bearer token to requests authenticated with the OpenID Connect (cookie) authentication, so the token can be used by the code that reads the Authorization header. The token is requested from the on-behalf-of provider when on-behalf-of settings exist, otherwise from the provider of the OpenID settings. The header is replaced by Bearer <token> and the token is stored in the BootstrapContext. The culture of the principal profile is added to the request in the culture header.

OpenIdBearerInjectorMiddlewareExtension

Registers and adds the OpenIdBearerInjectorMiddleware.

ValidateResourcesRightMiddleware

A middleware that protects resource paths with authorization policies. When the current principal does not satisfy the policy of the requested path, the response is a status 200 with the configured content instead of the resource.

ValidateResourcesRightMiddlewareExtension

Adds the ValidateResourcesRightMiddleware.

ValidateSwaggerRightMiddleware

A middleware that protects the Swagger document path: when the current principal does not have the right Access, the response is a status 200 with ContentToDisplay instead of the document.

ValidateSwaggerRightMiddlewareExtension

Adds the ValidateSwaggerRightMiddleware.

ValidateSwaggerRightMiddlewareOption

Configures the ValidateSwaggerRightMiddleware.