Paralax.Auth
1.0.450
dotnet add package Paralax.Auth --version 1.0.450
NuGet\Install-Package Paralax.Auth -Version 1.0.450
<PackageReference Include="Paralax.Auth" Version="1.0.450" />
<PackageVersion Include="Paralax.Auth" Version="1.0.450" />
<PackageReference Include="Paralax.Auth" />
paket add Paralax.Auth --version 1.0.450
#r "nuget: Paralax.Auth, 1.0.450"
#:package Paralax.Auth@1.0.450
#addin nuget:?package=Paralax.Auth&version=1.0.450
#tool nuget:?package=Paralax.Auth&version=1.0.450
Paralax.Auth
Paralax.Auth is a lightweight, extensible authentication module for the Paralax microservices framework, providing JWT-based authentication, token validation, and optional authentication bypass for development and internal scenarios.
It is designed for modern .NET microservices, with first-class support for ASP.NET Core, JWT Bearer authentication, and scalable distributed architectures.
โจ Features
- ๐ JWT authentication (HMAC or X.509 certificate based)
- ๐งฉ Seamless integration with the Paralax framework
- ๐๏ธ Clean extension-based configuration
- ๐ Token issuance and validation
- ๐ซ Token revocation (in-memory blacklist)
- ๐ Optional authentication disabling (development/testing)
- โก Minimal overhead, production-ready defaults
- ๐ง Strongly typed configuration options
๐ฆ Installation
Install from NuGet:
dotnet add package Paralax.Auth
๐ Quick Start
1๏ธโฃ Register authentication
builder.AddParalax()
.AddJwt();
By default, configuration is read from the jwt section in your configuration files.
2๏ธโฃ Enable middleware
app.UseAuthentication();
app.UseAuthorization();
app.UseAccessTokenValidator();
โ๏ธ Configuration
Basic symmetric key configuration (recommended for most services)
"jwt": {
"issuer": "paralax-auth",
"issuerSigningKey": "very_secure_secret_key_123456",
"expiryMinutes": 60,
"validateIssuer": true,
"validateAudience": false
}
X.509 certificate configuration (recommended for high-security environments)
"jwt": {
"issuer": "paralax-auth",
"certificate": {
"location": "certs/jwt-signing.pfx",
"password": "cert-password"
},
"expiryMinutes": 60
}
You may also provide the certificate as Base64 (rawData) instead of a file path.
๐งฉ JwtOptions Overview
| Option | Description |
|---|---|
Issuer |
Token issuer |
ValidIssuer(s) |
Allowed token issuers |
IssuerSigningKey |
Symmetric signing key |
Certificate |
X.509 certificate for signing |
Algorithm |
Security algorithm (default auto-selected) |
Expiry / ExpiryMinutes |
Token lifetime |
ValidateLifetime |
Enable expiration validation |
ValidateAudience |
Enable audience validation |
ValidAudience(s) |
Allowed audiences |
AuthenticationDisabled |
Disable authentication entirely |
AllowAnonymousEndpoints |
Paths excluded from validation |
๐ Issuing Tokens
Inject IJwtHandler and generate tokens programmatically:
public class AuthService
{
private readonly IJwtHandler _jwtHandler;
public AuthService(IJwtHandler jwtHandler)
{
_jwtHandler = jwtHandler;
}
public string CreateToken(string userId)
{
return _jwtHandler.CreateToken(userId).AccessToken;
}
}
Supports:
- User ID (subject)
- Role
- Audience
- Custom claims
๐ก๏ธ Token Validation & Revocation
Automatic validation
JWT validation is handled by ASP.NET Core authentication middleware.
Token revocation (logout support)
Paralax.Auth includes an in-memory token blacklist:
await accessTokenService.DeactivateCurrentAsync();
Once revoked, the token becomes invalid until it expires.
โ ๏ธ In-memory storage is per-instance. For distributed systems, use a shared cache (e.g. Redis) via a custom
IAccessTokenService.
๐ Disable Authentication (Development / Testing)
"jwt": {
"authenticationDisabled": true
}
This bypasses authentication entirely while preserving the request pipeline.
โ ๏ธ Never enable this in production.
๐งช Anonymous Endpoints
Exclude selected paths from token validation:
"jwt": {
"allowAnonymousEndpoints": [
"/health",
"/metrics",
"/swagger"
]
}
๐งฑ Architecture Overview
- Extensions โ Fluent configuration via
AddJwt - JwtHandler โ Token creation and parsing
- AccessTokenValidatorMiddleware โ Runtime validation
- IAccessTokenService โ Token revocation abstraction
- DisabledAuthenticationPolicyEvaluator โ Authentication bypass
The design follows SOLID principles and is fully extensible.
๐ Framework Compatibility
| .NET Version |
|---|
| .NET 8.0 |
| .NET 9.0 |
๐ License
Licensed under the Apache License 2.0.
See LICENSE.
๐ง When to Use Paralax.Auth
โ Microservices โ Internal APIs โ Gateway authentication โ Stateless JWT authentication โ Paralax-based systems
๐ค Contributing
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Submit a pull request
Repository: ๐ https://github.com/ITSharpPro/Paralax
๐ข Authors & Maintainers
ITSharpPro ๐ https://itsharppro.com
Andrii Voznesenskyi GitHub: https://github.com/SaintAngeLs
โญ Final Notes
Paralax.Auth is intentionally simple, explicit, and predictable. It provides full control over authentication without unnecessary abstractions.
If you need:
- Distributed token revocation
- External identity providers
- Advanced claim mapping
You can extend it cleanly without breaking the core.
Happy building ๐
| 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 was computed. 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. |
-
net8.0
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.8)
- Microsoft.AspNetCore.Authorization (>= 8.0.8)
- Microsoft.Extensions.Caching.Memory (>= 8.0.0)
- Microsoft.IdentityModel.Tokens (>= 8.0.2)
- Paralax (>= 1.0.448)
- System.IdentityModel.Tokens.Jwt (>= 8.0.2)
-
net9.0
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.8)
- Microsoft.AspNetCore.Authorization (>= 8.0.8)
- Microsoft.Extensions.Caching.Memory (>= 8.0.0)
- Microsoft.IdentityModel.Tokens (>= 8.0.2)
- Paralax (>= 1.0.448)
- System.IdentityModel.Tokens.Jwt (>= 8.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Paralax.Auth:
| Package | Downloads |
|---|---|
|
Paralax.Auth.Distributed
Paralax.Auth.Distributed - A distributed authentication framework for microservices architecture |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.450 | 342 | 1/4/2026 |
| 1.0.449 | 119 | 1/4/2026 |
| 1.0.448 | 1,621 | 2/8/2025 |
| 1.0.446 | 201 | 2/8/2025 |
| 1.0.443 | 263 | 1/31/2025 |
| 1.0.441 | 187 | 1/31/2025 |
| 1.0.436 | 359 | 12/15/2024 |
| 1.0.434 | 188 | 12/15/2024 |
| 1.0.432 | 220 | 12/15/2024 |
| 1.0.430 | 195 | 12/15/2024 |
| 1.0.428 | 213 | 12/15/2024 |
| 1.0.424 | 204 | 12/14/2024 |
| 1.0.420 | 265 | 11/23/2024 |
| 1.0.415 | 233 | 11/9/2024 |
| 1.0.410 | 195 | 11/9/2024 |
| 1.0.406 | 236 | 10/30/2024 |
| 1.0.404 | 197 | 10/30/2024 |
| 1.0.401 | 317 | 10/18/2024 |
| 1.0.396 | 212 | 10/18/2024 |
| 1.0.388 | 200 | 10/18/2024 |
Initial release of the Paralax.Auth library for managing authentication in scalable services.