AuthorizationInstaller — Web
Key: Authorization
Default Enabled: ✅
Package: SaveApis.Framework.Web
Purpose
Registers ASP.NET Core Authorization services and adds the UseAuthorization() middleware to the pipeline. Combined with AuthenticationInstaller, this enables policy-based and attribute-based access control on controllers and endpoints.
What It Does
Builder phase:
- Calls
builder.Services.AddAuthorization()— registers the authorization service
Application phase:
- Calls
app.UseAuthorization()— adds the authorization middleware that evaluates authorization policies on each request
Dependencies
| Dependency | Direction | Requirement | Description |
|---|---|---|---|
AuthenticationInstaller |
After | Required | Authentication must run before Authorization |
ZitadelInstaller |
Before | Required | Zitadel must run after Authorization |
ControllerInstaller |
Before | Optional | Controllers rely on authorization being present |
OpenApiInstaller |
Before | Optional | |
ScalarInstaller |
Before | Optional |
Configuration
This installer has no configuration options.
InstallerContext Extension
installer.WithAuthorization(bool enabled = true);
Notes
- All controllers registered by
ControllerInstallerhave.RequireAuthorization()applied globally. If you need to allow anonymous access on specific endpoints, apply[AllowAnonymous]to those controller actions. - To customize authorization policies, add a custom installer that calls
builder.Services.AddAuthorization(options => { ... })afterAuthorizationInstaller.
Related
- Web Framework Overview
- AuthenticationInstaller — prerequisite for this installer
- ZitadelInstaller — adds the authentication scheme
- ControllerInstaller — maps controllers with
RequireAuthorization()