Repository navigation
1.0.0 Beta
Pre-release
Pre-release
π¦ PsalmsJwtTokenService v1.0.0
β¨ Initial stable release
PsalmsJwtTokenService is a lightweight and extensible JWT generator for .NET applications. This first version provides a clean and secure foundation for token-based authentication, fully configurable via IConfiguration.
π Features
- β Secure JWT generation using HMAC-SHA256
- β Custom claims support
- β Reads values from IConfiguration (JWT:Key, Issuer, Audience, Expires)
- β Optional expiration handling (in hours)
- β Lazy-initialized cryptography objects
- β Fully covered with xUnit unit tests
π§ Required Configuration
{
"JWT": {
"Key": "your-secret-key",
"Issuer": "your-api",
"Audience": "your-client",
"Expires": "2"
}
}
π Example Usage
var claims = new[]
{
new Claim(ClaimTypes.Name, "John"),
new Claim(ClaimTypes.NameIdentifier, "123")
};
var token = jwtService.GenerateToken(claims);