Paralax.Auth 1.0.450

dotnet add package Paralax.Auth --version 1.0.450
                    
NuGet\Install-Package Paralax.Auth -Version 1.0.450
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Paralax.Auth" Version="1.0.450" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Paralax.Auth" Version="1.0.450" />
                    
Directory.Packages.props
<PackageReference Include="Paralax.Auth" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Paralax.Auth --version 1.0.450
                    
#r "nuget: Paralax.Auth, 1.0.450"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Paralax.Auth@1.0.450
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Paralax.Auth&version=1.0.450
                    
Install as a Cake Addin
#tool nuget:?package=Paralax.Auth&version=1.0.450
                    
Install as a Cake Tool

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

"jwt": {
  "issuer": "paralax-auth",
  "issuerSigningKey": "very_secure_secret_key_123456",
  "expiryMinutes": 60,
  "validateIssuer": true,
  "validateAudience": false
}

"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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Initial release of the Paralax.Auth library for managing authentication in scalable services.