Soenneker.Blazor.Auth.EntraRolesPrincipalFactory 11.0.482

Prefix Reserved
dotnet add package Soenneker.Blazor.Auth.EntraRolesPrincipalFactory --version 11.0.482
                    
NuGet\Install-Package Soenneker.Blazor.Auth.EntraRolesPrincipalFactory -Version 11.0.482
                    
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="Soenneker.Blazor.Auth.EntraRolesPrincipalFactory" Version="11.0.482" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Auth.EntraRolesPrincipalFactory" Version="11.0.482" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Auth.EntraRolesPrincipalFactory" />
                    
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 Soenneker.Blazor.Auth.EntraRolesPrincipalFactory --version 11.0.482
                    
#r "nuget: Soenneker.Blazor.Auth.EntraRolesPrincipalFactory, 11.0.482"
                    
#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 Soenneker.Blazor.Auth.EntraRolesPrincipalFactory@11.0.482
                    
#: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=Soenneker.Blazor.Auth.EntraRolesPrincipalFactory&version=11.0.482
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Auth.EntraRolesPrincipalFactory&version=11.0.482
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blazor.Auth.EntraRolesPrincipalFactory

A Blazor WebAssembly account principal factory that converts Microsoft Entra app roles into standard .NET role claims.

Installation

dotnet add package Soenneker.Blazor.Auth.EntraRolesPrincipalFactory

Registration

Register the factory on the authentication builder returned by AddMsalAuthentication:

using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Soenneker.Blazor.Auth.EntraRolesPrincipalFactory;

builder.Services
    .AddMsalAuthentication(options =>
    {
        builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
    })
    .AddAccountClaimsPrincipalFactory<EntraRolesPrincipalFactory>();

Do not also register another account claims principal factory; the last factory registration controls principal creation.

Role checks

For an Entra claim shaped like:

{
  "roles": ["Administrator", "Billing.Read"]
}

the factory adds one ClaimTypes.Role claim per nonblank value. Blazor authorization can then use the normal role APIs:

<AuthorizeView Roles="Administrator">
    <Authorized>
        <AdminDashboard />
    </Authorized>
</AuthorizeView>
bool isAdministrator = user.IsInRole("Administrator");

Role names are trimmed but otherwise preserved, including casing. Missing or empty roles claims add no roles. The package only maps claims already present in the authenticated account; app-role assignment and token emission remain Entra configuration concerns.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.482 114 11/19/2026
11.0.481 95 11/19/2026
11.0.480 89 11/19/2026
11.0.479 92 11/19/2026
11.0.477 93 11/18/2026
11.0.475 95 11/18/2026
11.0.472 91 11/18/2026
11.0.471 95 11/18/2026
11.0.470 98 11/16/2026
11.0.469 98 11/15/2026
11.0.468 99 11/15/2026
11.0.467 101 11/15/2026
11.0.466 99 11/15/2026
11.0.465 102 11/15/2026
11.0.464 99 11/14/2026
11.0.463 104 11/14/2026
11.0.462 111 11/12/2026
11.0.461 104 11/11/2026
11.0.460 95 11/11/2026
11.0.459 107 11/11/2026
Loading failed

Updated Soenneker.Gen.Web.Minifier to 11.0.86