A JWT (JSON Web Token) implementation for .NET
open sourceCC0-1.0 AND MITfree
Jwt.Net is a .NET library for creating (encoding), parsing (decoding) and verifying JSON Web Tokens (RFC 7519), with both a direct API and a fluent builder. It validates signatures and expiration, can turn individual validation steps off, decodes token headers, and takes a custom JSON serializer (Json.NET by default). Separate packages register it with Microsoft's dependency injection container and add an ASP.NET Core authentication handler that validates JWTs, with custom factories for the identity or authentication ticket. It runs on .NET Framework 3.5 to 4.8, .NET Standard 1.3 and 2.0, and .NET 6, 8 and 10. John Sheehan wrote it and Alexander Batishchev maintains it.
Problems it solves
- generate and validate JWT tokens in my C# app
- verify a JWT's signature and expiry in .NET Framework
- add JWT bearer authentication to an ASP.NET Core app
Features
- create, decode and verify JWTs
- fluent builder API
- expiration validation, with steps you can turn off
- custom JSON serializer
- ASP.NET Core authentication handler and DI registration packages
- runs on .NET Framework 3.5 through .NET 10
Alternatives
The same job
These do what Jwt.Net does.
- jose-jwt Zero-dependency JOSE, JWT, JWE and JWK library for .NET
- OpenIddict A versatile OAuth 2.0 and OpenID Connect stack for .NET