Class IdentityServerMiddleware
- Namespace
- Fdyay.IdentityServer.Hosting
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Dispatches identity server protocol requests to the matching endpoint handler.
public sealed class IdentityServerMiddleware
- Inheritance
-
IdentityServerMiddleware
- Inherited Members
Remarks
It is also the one place that sees a fault from any of them, which is why the UnhandledExceptionEvent is raised here rather than in each endpoint — and, for the same reason, where a protocol request is measured and traced.
Constructors
IdentityServerMiddleware(RequestDelegate)
Creates the middleware ahead of the rest of the pipeline.
public IdentityServerMiddleware(RequestDelegate next)
Parameters
nextRequestDelegateThe pipeline a request that is not for a protocol endpoint, or that its endpoint passes on, continues to.
Methods
Invoke(HttpContext, IEndpointRouter, IEventService)
Routes the request to its protocol endpoint, runs the handler and writes its result, or passes the request on
when no endpoint matches or the handler returns null. At an mTLS alias the client certificate is authenticated
first, and a failure is answered 400 invalid_client.
public Task Invoke(HttpContext context, IEndpointRouter router, IEventService events)
Parameters
contextHttpContextThe request.
routerIEndpointRouterFinds the endpoint handler for the request.
eventsIEventServiceReceives the UnhandledExceptionEvent when a handler throws.
Returns
Exceptions
- InvalidOperationException
The request is at an mTLS alias and no authentication handler is registered under
MutualTls.ClientCertificateAuthenticationScheme.