Linger.AspNetCore.Jwt.Contracts
2.0.0-preview.1
dotnet add package Linger.AspNetCore.Jwt.Contracts --version 2.0.0-preview.1
NuGet\Install-Package Linger.AspNetCore.Jwt.Contracts -Version 2.0.0-preview.1
<PackageReference Include="Linger.AspNetCore.Jwt.Contracts" Version="2.0.0-preview.1" />
<PackageVersion Include="Linger.AspNetCore.Jwt.Contracts" Version="2.0.0-preview.1" />
<PackageReference Include="Linger.AspNetCore.Jwt.Contracts" />
paket add Linger.AspNetCore.Jwt.Contracts --version 2.0.0-preview.1
#r "nuget: Linger.AspNetCore.Jwt.Contracts, 2.0.0-preview.1"
#:package Linger.AspNetCore.Jwt.Contracts@2.0.0-preview.1
#addin nuget:?package=Linger.AspNetCore.Jwt.Contracts&version=2.0.0-preview.1&prerelease
#tool nuget:?package=Linger.AspNetCore.Jwt.Contracts&version=2.0.0-preview.1&prerelease
Linger.AspNetCore.Jwt.Contracts
Breaking changes and 2.0 migration notes are documented in the Linger migration guide.
Core interfaces and abstractions for JWT (JSON Web Token) authentication and authorization in ASP.NET Core applications.
Features
- Standardized interfaces for JWT token generation and validation
- Support for refresh token functionality
- Clean separation between contracts and implementation
- JWT configuration options model
- Extension methods for service registration
Supported Frameworks
- .NET 8.0+
- .NET 9.0+
Installation
dotnet add package Linger.AspNetCore.Jwt.Contracts
Core Interfaces
IJwtService
public interface IJwtService
{
/// <summary>
/// Creates a JWT token
/// </summary>
/// <param name="userId">User identifier</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Token object containing the access token</returns>
Task<Token> CreateTokenAsync(string userId, CancellationToken cancellationToken = default);
}
IRefreshableJwtService
public interface IRefreshableJwtService : IJwtService
{
/// <summary>
/// Refreshes a JWT token
/// </summary>
/// <param name="token">Token object containing access token and refresh token</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>New token object</returns>
Task<Token> RefreshTokenAsync(Token token, CancellationToken cancellationToken = default);
}
Linger.AspNetCore.Jwt.JwtServiceWithRefresh separates initial storage from rotation. Derived services implement StoreRefreshTokenAsync for first issuance and TryRotateRefreshTokenAsync for refresh. The latter must atomically compare the presented token and replace it in the storage layer; never implement rotation as a read followed by a write, or concurrent refreshes can both succeed.
Related Packages
- Linger.AspNetCore.Jwt - Implementation of these contracts
| Product | Versions 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 is compatible. 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. |
-
net10.0
- Microsoft.IdentityModel.JsonWebTokens (>= 8.19.2)
-
net8.0
- Microsoft.IdentityModel.JsonWebTokens (>= 8.19.2)
-
net9.0
- Microsoft.IdentityModel.JsonWebTokens (>= 8.19.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Linger.AspNetCore.Jwt.Contracts:
| Package | Downloads |
|---|---|
|
Linger.AspNetCore.Jwt
A comprehensive JWT authentication implementation for ASP.NET Core applications. Provides JWT token generation, validation, and refresh token functionality. Integrates seamlessly with ASP.NET Core authentication services. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.1 | 49 | 8/29/2026 |
| 1.6.4 | 117 | 8/16/2026 |
| 1.6.3 | 111 | 8/5/2026 |
| 1.6.2 | 135 | 8/2/2026 |
| 1.6.0 | 121 | 7/25/2026 |
| 1.5.5 | 125 | 7/23/2026 |
| 1.5.4-preview | 110 | 7/21/2026 |
| 1.5.3-preview | 113 | 7/20/2026 |
| 1.5.2-preview | 114 | 7/19/2026 |
| 1.5.1-preview | 113 | 7/15/2026 |
| 1.5.0-preview | 109 | 7/14/2026 |
| 1.4.4-preview | 127 | 6/16/2026 |
| 1.4.3-preview | 123 | 6/15/2026 |
| 1.4.2 | 139 | 5/20/2026 |
| 1.4.1-preview | 125 | 5/12/2026 |
| 1.4.0 | 130 | 5/6/2026 |
| 1.3.3-preview | 120 | 5/5/2026 |
| 1.3.2-preview | 123 | 4/29/2026 |
| 1.3.1-preview | 117 | 4/28/2026 |
| 1.3.0-preview | 126 | 4/27/2026 |