Trellis.Asp.Authorization 3.0.0-alpha.140

This is a prerelease version of Trellis.Asp.Authorization.
dotnet add package Trellis.Asp.Authorization --version 3.0.0-alpha.140
                    
NuGet\Install-Package Trellis.Asp.Authorization -Version 3.0.0-alpha.140
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Trellis.Asp.Authorization" Version="3.0.0-alpha.140" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Trellis.Asp.Authorization" Version="3.0.0-alpha.140" />
                    
Directory.Packages.props
<PackageReference Include="Trellis.Asp.Authorization" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Trellis.Asp.Authorization --version 3.0.0-alpha.140
                    
#r "nuget: Trellis.Asp.Authorization, 3.0.0-alpha.140"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Trellis.Asp.Authorization@3.0.0-alpha.140
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Trellis.Asp.Authorization&version=3.0.0-alpha.140&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Trellis.Asp.Authorization&version=3.0.0-alpha.140&prerelease
                    
Install as a Cake Tool

Trellis.Asp.Authorization

ASP.NET Core actor providers for Trellis.

Provides two IActorProvider implementations:

  • EntraActorProvider — Production. Maps Azure Entra ID v2.0 JWT claims to Actor.
  • DevelopmentActorProvider — Development/testing. Reads Actor from X-Test-Actor HTTP header with production environment guard.

Quick Start

using Trellis.Asp.Authorization;

if (builder.Environment.IsDevelopment())
    builder.Services.AddDevelopmentActorProvider();
else
    builder.Services.AddEntraActorProvider();

Default mapping:

Actor Property Source
Id oid claim
Permissions roles claims
ForbiddenPermissions Empty (override to populate)
Attributes tid, preferred_username, azp, azpacr, acrs, ip_address, mfa

mfa is derived from the amr claim and treats mfa, Mfa, and MFA equivalently.

Customization

builder.Services.AddEntraActorProvider(options =>
{
    // Flatten roles into granular permissions
    options.MapPermissions = claims => claims
        .Where(c => c.Type == "roles")
        .SelectMany(role => RolePermissionMap[role.Value])
        .ToHashSet();

    // Populate deny list from a custom claim
    options.MapForbiddenPermissions = claims => claims
        .Where(c => c.Type == "denied_permissions")
        .Select(c => c.Value)
        .ToHashSet();
});

If a custom MapPermissions, MapForbiddenPermissions, or MapAttributes delegate throws, EntraActorProvider wraps the original exception with context identifying which delegate failed.

Requirements

  • .NET 10.0+
  • ASP.NET Core (for DevelopmentActorProvider: any environment; for EntraActorProvider: authentication middleware e.g., AddMicrosoftIdentityWebApi)

See the full documentation for details.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-alpha.140 47 3/30/2026
3.0.0-alpha.137 53 3/27/2026
3.0.0-alpha.135 38 3/26/2026
3.0.0-alpha.127 43 3/23/2026
3.0.0-alpha.123 46 3/19/2026
3.0.0-alpha.118 55 3/14/2026
3.0.0-alpha.111 45 3/12/2026
3.0.0-alpha.104 39 3/9/2026
3.0.0-alpha.100 40 3/4/2026
3.0.0-alpha.99 39 3/4/2026
3.0.0-alpha.98 41 3/3/2026
3.0.0-alpha.95 44 3/2/2026
3.0.0-alpha.94 41 3/2/2026
3.0.0-alpha.93 45 3/1/2026
3.0.0-alpha.92 53 2/28/2026