Class AuthorizationPipelineExtensions
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- Excalibur.Dispatch.dll
Extension methods for adding authorization middleware to the dispatch pipeline.
public static class AuthorizationPipelineExtensions
- Inheritance
-
AuthorizationPipelineExtensions
- Inherited Members
Methods
UseAuthorization(IDispatchBuilder)
Adds authorization middleware to the dispatch pipeline.
public static IDispatchBuilder UseAuthorization(this IDispatchBuilder builder)
Parameters
builderIDispatchBuilderThe dispatch builder.
Returns
- IDispatchBuilder
The builder for fluent configuration.
Remarks
The authorization middleware verifies that the current principal has the required permissions before allowing the message to proceed to downstream handlers.
Authorization services must be registered separately in the DI container. This method only adds the middleware to the pipeline.
Recommended pipeline order:
builder.UseExceptionMapping()
.UseAuthentication() // Authenticate first
.UseAuthorization() // Then authorize
.UseValidation()
.UseRetry();