Cirreum.Runtime.AuthorizationProvider
1.0.20
dotnet add package Cirreum.Runtime.AuthorizationProvider --version 1.0.20
NuGet\Install-Package Cirreum.Runtime.AuthorizationProvider -Version 1.0.20
<PackageReference Include="Cirreum.Runtime.AuthorizationProvider" Version="1.0.20" />
<PackageVersion Include="Cirreum.Runtime.AuthorizationProvider" Version="1.0.20" />
<PackageReference Include="Cirreum.Runtime.AuthorizationProvider" />
paket add Cirreum.Runtime.AuthorizationProvider --version 1.0.20
#r "nuget: Cirreum.Runtime.AuthorizationProvider, 1.0.20"
#:package Cirreum.Runtime.AuthorizationProvider@1.0.20
#addin nuget:?package=Cirreum.Runtime.AuthorizationProvider&version=1.0.20
#tool nuget:?package=Cirreum.Runtime.AuthorizationProvider&version=1.0.20
Cirreum.Runtime.AuthorizationProvider
Base registration infrastructure for Cirreum authorization providers
Overview
Cirreum.Runtime.AuthorizationProvider provides the runtime layer for registering authorization providers with ASP.NET Core applications. It includes the provider registration pattern, role enrichment via claims transformation, and diagnostics. This package is typically not referenced directly.
Note: For the complete authorization system with all provider implementations (Entra ID, API Key, Signed Request, External/BYOID), see Cirreum.Runtime.Authorization. Most applications should reference that package instead of this one directly.
Features
- Type-safe provider registration with generic constraints
- Configuration-driven setup using hierarchical configuration sections
- Multiple provider instances support per registrar type
- Role enrichment via
IRoleResolver— resolves application roles from your data store and adds them asClaimTypes.Roleclaims - Diagnostics —
ActivitySource,Meter, and per-requestClaimsTransformResultstashed inHttpContext.Itemsfor debugging - Duplicate registration protection with automatic detection
- Structured logging with deferred execution for performance
- Seamless ASP.NET Core integration through
IHostApplicationBuilderextensions
Installation
dotnet add package Cirreum.Runtime.AuthorizationProvider
Usage
Provider Registration
Authorization providers are registered during application startup. Each provider type has its own registrar that reads from the hierarchical configuration:
var builder = DomainApplication.CreateBuilder(args);
var authBuilder = builder.Services.AddAuthentication();
// Register an authorization provider (typically called by the Runtime)
builder.RegisterAuthorizationProvider<EntraAuthorizationRegistrar, EntraAuthorizationSettings, EntraAuthorizationInstanceSettings>(authBuilder);
Configuration Structure
Configure your authorization providers in appsettings.json. Instances are keyed by name:
{
"Cirreum": {
"Authorization": {
"Providers": {
"Entra": {
"Instances": {
"Primary": {
"Enabled": true,
"Audience": "api://my-app",
"TenantId": "your-tenant-id",
"ClientId": "your-client-id"
}
}
}
}
}
}
}
Role Enrichment
For audience-based providers (Entra, Okta, OIDC), you can resolve application roles from your data store and add them as claims. Register your IRoleResolver implementation via CirreumAuthorizationBuilder:
builder.AddAuthorization(auth => auth
.AddRoleResolver<MyRoleResolver>()
);
The resolver is called once per request during claims transformation. Requests that already carry role claims (e.g., workforce tokens) are skipped automatically.
public class MyRoleResolver : IRoleResolver {
public async Task<IReadOnlyList<string>?> ResolveRolesAsync(
string externalUserId,
CancellationToken cancellationToken = default) {
// Load roles from your database
return await db.GetRolesForUserAsync(externalUserId, cancellationToken);
}
}
Diagnostics
The claims transformer stashes a ClaimsTransformResult in HttpContext.Items after every transformation pass. Useful for debugging authorization issues in middleware or diagnostic endpoints:
if (httpContext.Items[ClaimsTransformResult.ItemsKey] is ClaimsTransformResult result) {
// result.Outcome: "RolesResolved", "AlreadyTransformed", "NoUserIdentifier", etc.
// result.ResolverType: "MyRoleResolver"
// result.UserId: The external user ID from the token
// result.RoleClaimType: The claim type used for roles
// result.RoleCount: Number of roles added
}
Telemetry is produced via System.Diagnostics using the diagnostic name Cirreum.AuthorizationProvider. The OTel subscription is handled automatically by CirreumAuthorizationBuilder.AddRoleResolver<T>().
Contribution Guidelines
Be conservative with new abstractions
The API surface must remain stable and meaningful.Limit dependency expansion
Only add foundational, version-stable dependencies.Favor additive, non-breaking changes
Breaking changes ripple through the entire ecosystem.Include thorough unit tests
All primitives and patterns should be independently testable.Document architectural decisions
Context and reasoning should be clear for future maintainers.Follow .NET conventions
Use established patterns from Microsoft.Extensions.* libraries.
Versioning
Cirreum.Runtime.AuthorizationProvider follows Semantic Versioning:
- Major - Breaking API changes
- Minor - New features, backward compatible
- Patch - Bug fixes, backward compatible
Given its foundational role, major version bumps are rare and carefully considered.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Cirreum Foundation Framework
Layered simplicity for modern .NET
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Cirreum.AuthorizationProvider (>= 1.0.26)
- Cirreum.Logging.Deferred (>= 1.0.113)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cirreum.Runtime.AuthorizationProvider:
| Package | Downloads |
|---|---|
|
Cirreum.Runtime.Authorization
The Runtime Authorization configuration. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.20 | 123 | 5/7/2026 |
| 1.0.19 | 110 | 5/1/2026 |
| 1.0.18 | 110 | 4/28/2026 |
| 1.0.17 | 126 | 4/26/2026 |
| 1.0.16 | 129 | 4/15/2026 |
| 1.0.15 | 192 | 3/17/2026 |
| 1.0.14 | 155 | 3/13/2026 |
| 1.0.12 | 135 | 3/10/2026 |
| 1.0.11 | 118 | 3/9/2026 |
| 1.0.10 | 106 | 3/6/2026 |
| 1.0.9 | 189 | 1/21/2026 |
| 1.0.8 | 273 | 12/20/2025 |
| 1.0.7 | 143 | 12/20/2025 |
| 1.0.6 | 199 | 12/20/2025 |
| 1.0.5 | 249 | 12/19/2025 |
| 1.0.4 | 287 | 12/19/2025 |
| 1.0.3 | 310 | 12/16/2025 |
| 1.0.2 | 206 | 11/29/2025 |
| 1.0.1 | 243 | 11/24/2025 |
| 1.0.0 | 315 | 11/21/2025 |