Vault42.Blazor
1.0.4
dotnet add package Vault42.Blazor --version 1.0.4
NuGet\Install-Package Vault42.Blazor -Version 1.0.4
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="Vault42.Blazor" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vault42.Blazor" Version="1.0.4" />
<PackageReference Include="Vault42.Blazor" />
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 Vault42.Blazor --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Vault42.Blazor, 1.0.4"
#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 Vault42.Blazor@1.0.4
#: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=Vault42.Blazor&version=1.0.4
#tool nuget:?package=Vault42.Blazor&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Vault42 .NET SDK
Client libraries for Vault42 — a production-grade Go JWT authentication server.
This repository ships two NuGet packages:
| Package | Purpose |
|---|---|
Vault42.AspNetCore |
ASP.NET Core authentication middleware. Validates RS256 JWTs against Vault42's JWKS endpoint, with auto-refresh, claim mapping, fingerprint validation, and authorization policies. |
Vault42.Blazor |
Blazor WebAssembly authentication library. Implements OAuth2 Authorization Code + PKCE (S256) and integrates with AuthenticationStateProvider. |
Both target .NET 10.0.
Install
dotnet add package Vault42.AspNetCore
dotnet add package Vault42.Blazor
Vault42.AspNetCore — minimal usage
using Vault42.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddAuthentication(VaultDefaults.AuthenticationScheme)
.AddVault(options =>
{
options.Authority = "https://vault42.example.com";
// Defaults — override if needed:
// options.MaxTokenSize = 8192; // 8 KB cap (matches server)
// options.JwksRefreshInterval = TimeSpan.FromMinutes(5);
// options.MaxJwksBytes = 1L * 1024 * 1024;
// options.JwksHttpTimeout = TimeSpan.FromSeconds(10);
// options.RequireHttpsMetadata = true;
// options.ValidateFingerprint = false;
});
var app = builder.Build();
await app.Services.UseVaultAuthenticationAsync();
app.UseAuthentication();
app.UseAuthorization();
Security defaults (cannot be disabled by configuration):
- Algorithm whitelist:
RS256only —none,HS256, etc. are rejected. - Dangerous JWT headers (
jku,x5u,x5c,jwk) are rejected. - JWKS keys must declare
use=sig(or nouse) andalg=RS256(or noalg). - RSA modulus < 2048 bits is rejected.
- JWKS body is bounded by
MaxJwksBytes. - Token validation failures return a generic
invalid_tokenreason — no validator-specific leakage.
Vault42.Blazor — minimal usage
using Vault42.Blazor;
builder.Services.AddVaultAuth(options =>
{
options.Authority = "https://vault42.example.com";
options.ClientId = "my-blazor-app";
options.RedirectUri = "https://myapp.com/auth/callback";
// Defaults — override if needed:
// options.RefreshStorage = RefreshTokenStorage.HttpOnlyCookieOnly;
});
RefreshStorage trade-offs:
HttpOnlyCookieOnly(default) — refresh token never touches JS storage. Vault42 server issuesHttpOnly + Secure + SameSite=Strictcookies; the browser auto-attaches them. Best XSS resistance. Requires same-origin or CORS-with-credentials origin.InMemoryOnly— refresh token kept in process memory; lost on full reload. XSS-resistant.SessionStorage— legacy XSS-readable persistence. Opt-in only; document the risk in your app.
Versioning
| Line | Targets | Status |
|---|---|---|
| 0.2.x | net10.0 | Current — see CHANGELOG.md |
| 0.1.x | net8.0, net10.0 | Maintenance — pin if you cannot leave net8 |
License
MIT. See repository root LICENSE.
Security
Report vulnerabilities to vault@42-v.com (Tuta, end-to-end encrypted). Do not open a public GitHub issue. Full policy: SECURITY.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- Microsoft.AspNetCore.Components.Authorization (>= 10.0.11)
- Microsoft.AspNetCore.Components.Web (>= 10.0.11)
- Microsoft.Extensions.Http (>= 10.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See CHANGELOG.md at https://github.com/42-v/vault42/blob/main/packages/dotnet/CHANGELOG.md