Soenneker.Extensions.IIdentity 11.0.525

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.IIdentity --version 11.0.525
                    
NuGet\Install-Package Soenneker.Extensions.IIdentity -Version 11.0.525
                    
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.Extensions.IIdentity" Version="11.0.525" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.IIdentity" Version="11.0.525" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.IIdentity" />
                    
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.Extensions.IIdentity --version 11.0.525
                    
#r "nuget: Soenneker.Extensions.IIdentity, 11.0.525"
                    
#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.Extensions.IIdentity@11.0.525
                    
#: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.Extensions.IIdentity&version=11.0.525
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.IIdentity&version=11.0.525
                    
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

alternate text is missing from this package README image Soenneker.Extensions.IIdentity

Promotes selected identity claims into standard .NET role claims for authorization.

Installation

dotnet add package Soenneker.Extensions.IIdentity

Promote a comma-separated job title claim

using Soenneker.Extensions.IIdentity;

identity.AddRolesFromJobTitle();

Given a jobTitle claim such as "Administrator, Billing", AddRolesFromJobTitle() adds ClaimTypes.Role claims for Administrator and Billing. Values are split on commas, trimmed, and blank entries are skipped.

Promote a JSON roles claim

identity.AddRolesFromRoles();

AddRolesFromRoles() expects the first roles claim to contain a JSON string array:

["Administrator", "Billing"]

Blank elements are skipped. Malformed JSON and an empty array add no roles.

Both methods:

  • Modify the existing identity only when it is a ClaimsIdentity; null and other IIdentity implementations are unchanged.
  • Read only the first source claim of the relevant type.
  • Preserve the source claim and add standard role claims alongside it.
  • Do not add an exact duplicate of an existing role claim, making repeated calls idempotent.

These methods turn claim text directly into authorization roles. Call them only after the identity and source claims have been authenticated and validated against a trusted issuer. They do not verify token signatures, issuers, audiences, or which role names your application permits.

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 (2)

Showing the top 2 NuGet packages that depend on Soenneker.Extensions.IIdentity:

Package Downloads
Soenneker.Blazor.Auth.RolesPrincipalFactory

Customizes Blazor WebAssembly authentication by extending AccountClaimsPrincipalFactory to add user roles based on their job title.

Soenneker.Blazor.Auth.EntraRolesPrincipalFactory

Customizes Blazor authentication by extending AccountClaimsPrincipalFactory to add standard roles claims from Azure Entra

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.540 262 11/19/2026
11.0.539 129 11/19/2026
11.0.538 91 11/18/2026
11.0.537 107 11/18/2026
11.0.534 189 11/15/2026
11.0.533 177 11/14/2026
11.0.532 232 11/11/2026
11.0.531 126 11/11/2026
11.0.530 131 11/11/2026
11.0.529 144 11/11/2026
11.0.528 110 11/11/2026
11.0.527 125 11/11/2026
11.0.526 123 11/11/2026
11.0.525 145 11/10/2026
11.0.524 366 11/3/2026
11.0.523 127 11/3/2026
11.0.521 127 11/3/2026
11.0.519 123 11/3/2026
11.0.517 186 10/29/2026
11.0.516 152 10/27/2026
Loading failed

Disable .NET CLI telemetry and welcome messages in workflows