HyperDev.IdentityModel 1.2.1

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

HyperDev.IdentityModel

JWT helpers built on System.IdentityModel.Tokens.Jwt, part of the HyperDev Fatum framework. Reads bearer tokens from HTTP headers and turns them into a ClaimsPrincipal.

  • Parsing of a JWT from a string, with or without the Bearer prefix (base64 padding and +// characters are normalized)
  • Extensions on IDictionary<string, StringValues> (for example ASP.NET Core request headers) to read the token or the identity from the Authorization header or any other header
  • Claim lookup on a JwtSecurityToken (case-insensitive claim type) and token serialization
  • IClaimsPrincipalAccessor abstraction and an anonymous principal factory

The token is only read, not validated: signature, issuer, audience and lifetime are not checked. Use these helpers where the token has already been validated, or validate it with JwtSecurityTokenHandler.ValidateToken.

Installation

dotnet add package HyperDev.IdentityModel

Quick start

using HyperDev.IdentityModel;
using Microsoft.Extensions.Primitives;

var headers = new Dictionary<string, StringValues>
{
    ["Authorization"] = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MiJ9.c2lnbmF0dXJl"
};

if (headers.TryGetJwtToken(out var token) && token.TryGetClaim("sub", out var subject))
    Console.WriteLine($"Subject: {subject}");

if (headers.TryGetJwtIdentity(out var principal))
    Console.WriteLine(principal.Identity.AuthenticationType); // "jwt"

Target frameworks

.NET 8.0, .NET 10.0

License

MIT, © Ivan Senatore, Wemake Informatica srl. Third-party dependencies keep their own licenses (System.IdentityModel.Tokens.Jwt: MIT, Microsoft.Extensions.*: MIT).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (1)

Showing the top 1 NuGet packages that depend on HyperDev.IdentityModel:

Package Downloads
HyperDev.Web

HyperDev Fatum Framework

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 130 11/7/2026
1.2.0 211 7/29/2026
1.0.1 247 2/6/2026
1.0.0 180 2/5/2026