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
nextRequestDelegateThe next middleware of the pipeline.
activitySourceFactoryIActivitySourceFactoryThe factory of the activity source used for telemetry.
Exceptions
- ArgumentNullException
nextis null.
Methods
InvokeAsync(HttpContext, ILogger<AddContextToPrincipalMiddleware>)
Processes the request.
public Task InvokeAsync(HttpContext context, ILogger<AddContextToPrincipalMiddleware> logger)
Parameters
contextHttpContextThe HTTP context.
loggerILogger<AddContextToPrincipalMiddleware>The logger.
Returns
- Task
A task that completes when the rest of the pipeline is done.
Exceptions
- ArgumentNullException
contextis null.