ArturRios.Jwt
A minimal API for creating, validating and reading JSON Web Tokens, with signing-key rotation.
A clean, minimal token library — and the only member of the family that depends on nothing else in it, so a service can issue and verify tokens without adopting anything more.
What you get
- Create signed JWTs (HMAC-SHA256) from a
JwtConfiguration. - Validate a token signature against a secret, or against a set of keys.
- Rotate signing keys without invalidating tokens already issued.
- Read the user id from the
idclaim, and thekidnaming the key that signed the token. - Validate a
JwtConfigurationwith FluentValidation rules before using it.
ArturRios.Util.WebApi builds on this for its authentication middleware.
Install
dotnet add package ArturRios.Jwt
Family dependencies
None.
Links
- Documentation: https://docs.artur-rios.tech/dotnet-jwt
- Repository: https://github.com/artur-rios/dotnet-jwt
- NuGet: https://www.nuget.org/packages/ArturRios.Jwt