Soenneker.Extensions.IIdentity 4.0.444

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 4.0.444
                    
NuGet\Install-Package Soenneker.Extensions.IIdentity -Version 4.0.444
                    
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="4.0.444" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.IIdentity" Version="4.0.444" />
                    
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 4.0.444
                    
#r "nuget: Soenneker.Extensions.IIdentity, 4.0.444"
                    
#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@4.0.444
                    
#: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=4.0.444
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.IIdentity&version=4.0.444
                    
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 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 (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
4.0.446 0 9/5/2026
4.0.445 42 9/4/2026
4.0.444 47 9/4/2026
4.0.443 32 9/4/2026
4.0.442 46 9/4/2026
4.0.441 48 9/4/2026
4.0.440 46 9/4/2026
4.0.439 33 9/4/2026
4.0.438 46 9/4/2026
4.0.437 78 9/3/2026
4.0.436 124 9/1/2026
4.0.435 100 9/1/2026
4.0.434 104 8/31/2026
4.0.433 109 8/31/2026
4.0.432 102 8/31/2026
4.0.431 100 8/31/2026
4.0.430 109 8/31/2026
4.0.429 108 8/31/2026
4.0.428 82 8/31/2026
4.0.427 116 8/30/2026
Loading failed

Update dependency Soenneker.Utils.Json to 4.0.2678 (#983)