Soenneker.Extensions.List.Claims
4.0.55
Prefix Reserved
dotnet add package Soenneker.Extensions.List.Claims --version 4.0.55
NuGet\Install-Package Soenneker.Extensions.List.Claims -Version 4.0.55
<PackageReference Include="Soenneker.Extensions.List.Claims" Version="4.0.55" />
<PackageVersion Include="Soenneker.Extensions.List.Claims" Version="4.0.55" />
<PackageReference Include="Soenneker.Extensions.List.Claims" />
paket add Soenneker.Extensions.List.Claims --version 4.0.55
#r "nuget: Soenneker.Extensions.List.Claims, 4.0.55"
#:package Soenneker.Extensions.List.Claims@4.0.55
#addin nuget:?package=Soenneker.Extensions.List.Claims&version=4.0.55
#tool nuget:?package=Soenneker.Extensions.List.Claims&version=4.0.55
Soenneker.Extensions.List.Claims
Extension methods for turning claim lists into identities, principals, and other authentication-friendly representations.
Installation
dotnet add package Soenneker.Extensions.List.Claims
Usage
using Soenneker.Extensions.List.Claims;
var claims = new List<Claim>
{
new(ClaimTypes.NameIdentifier, "customer-123"),
new(ClaimTypes.Role, "admin")
};
ClaimsPrincipal principal = claims.ToClaimsPrincipal("Bearer");
authenticationType is passed directly to ClaimsIdentity. A nonempty value makes principal.Identity.IsAuthenticated return true; this is a .NET identity-state convention, not proof that a token, credential, issuer, or claim was validated.
Only construct an authenticated principal from claims produced by a trusted authentication process. Calling this method on request-supplied claims with a label such as "Bearer" does not authenticate the caller and can create an authorization vulnerability.
The resulting principal contains one identity when the list has at least one claim. An empty claim list returns a principal with no identities, regardless of authenticationType:
ClaimsPrincipal empty = new List<Claim>().ToClaimsPrincipal("Bearer");
bool hasIdentity = empty.Identity is not null; // false
A null list throws ArgumentNullException. The method does not deduplicate, normalize, filter, or validate claim types and values.
| 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Extensions.List.Claims:
| Package | Downloads |
|---|---|
|
Soenneker.Utils.Test.AuthHandler
A custom test authentication handler that builds a ClaimsPrincipal from headers or a JWT to simulate authenticated users during integration tests. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.55 | 85 | 8/30/2026 |
| 4.0.54 | 40 | 8/29/2026 |
| 4.0.52 | 61 | 8/29/2026 |
| 4.0.51 | 1,902 | 7/28/2026 |
| 4.0.50 | 1,041 | 7/16/2026 |
| 4.0.49 | 2,161 | 6/18/2026 |
| 4.0.48 | 1,568 | 6/5/2026 |
| 4.0.46 | 3,315 | 3/12/2026 |
| 4.0.45 | 155 | 3/12/2026 |
| 4.0.44 | 110 | 3/12/2026 |
| 4.0.43 | 225 | 3/12/2026 |
| 4.0.42 | 453 | 3/10/2026 |
| 4.0.41 | 467 | 3/9/2026 |
| 4.0.40 | 181 | 3/9/2026 |
| 4.0.39 | 175 | 3/9/2026 |
| 4.0.38 | 661 | 3/4/2026 |
| 4.0.37 | 1,578 | 1/20/2026 |
| 4.0.36 | 378 | 1/14/2026 |
| 4.0.34 | 2,755 | 11/20/2025 |
| 4.0.33 | 836 | 11/6/2025 |
Clarify claims principal trust boundary