Soenneker.Extensions.IIdentity
4.0.442
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.IIdentity --version 4.0.442
NuGet\Install-Package Soenneker.Extensions.IIdentity -Version 4.0.442
<PackageReference Include="Soenneker.Extensions.IIdentity" Version="4.0.442" />
<PackageVersion Include="Soenneker.Extensions.IIdentity" Version="4.0.442" />
<PackageReference Include="Soenneker.Extensions.IIdentity" />
paket add Soenneker.Extensions.IIdentity --version 4.0.442
#r "nuget: Soenneker.Extensions.IIdentity, 4.0.442"
#:package Soenneker.Extensions.IIdentity@4.0.442
#addin nuget:?package=Soenneker.Extensions.IIdentity&version=4.0.442
#tool nuget:?package=Soenneker.Extensions.IIdentity&version=4.0.442
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;nulland otherIIdentityimplementations 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 | 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
- Soenneker.Extensions.Enumerable (>= 4.0.658)
- Soenneker.Utils.Json (>= 4.0.2676)
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 | 47 | 9/5/2026 |
| 4.0.445 | 55 | 9/4/2026 |
| 4.0.444 | 54 | 9/4/2026 |
| 4.0.443 | 37 | 9/4/2026 |
| 4.0.442 | 53 | 9/4/2026 |
| 4.0.441 | 53 | 9/4/2026 |
| 4.0.440 | 51 | 9/4/2026 |
| 4.0.439 | 37 | 9/4/2026 |
| 4.0.438 | 50 | 9/4/2026 |
| 4.0.437 | 84 | 9/3/2026 |
| 4.0.436 | 125 | 9/1/2026 |
| 4.0.435 | 101 | 9/1/2026 |
| 4.0.434 | 104 | 8/31/2026 |
| 4.0.433 | 110 | 8/31/2026 |
| 4.0.432 | 103 | 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 |
Updated Soenneker.Utils.Json to 4.0.2676