Table of Contents

Class AddContextToPrincipalMiddleware

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

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.

public class AddContextToPrincipalMiddleware
Inheritance
AddContextToPrincipalMiddleware
Inherited Members

Constructors

AddContextToPrincipalMiddleware(RequestDelegate, IActivitySourceFactory)

Initializes a new instance of the AddContextToPrincipalMiddleware class.

public AddContextToPrincipalMiddleware(RequestDelegate next, IActivitySourceFactory activitySourceFactory)

Parameters

next RequestDelegate

The next middleware of the pipeline.

activitySourceFactory IActivitySourceFactory

The factory of the activity source used for telemetry.

Exceptions

ArgumentNullException

next is null.

Methods

InvokeAsync(HttpContext, ILogger<AddContextToPrincipalMiddleware>)

Processes the request.

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

Parameters

context HttpContext

The HTTP context.

logger ILogger<AddContextToPrincipalMiddleware>

The logger.

Returns

Task

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

Exceptions

ArgumentNullException

context is null.