Faactory.Jwks 0.1.3

dotnet add package Faactory.Jwks --version 0.1.3
                    
NuGet\Install-Package Faactory.Jwks -Version 0.1.3
                    
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="Faactory.Jwks" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Faactory.Jwks" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Faactory.Jwks" />
                    
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 Faactory.Jwks --version 0.1.3
                    
#r "nuget: Faactory.Jwks, 0.1.3"
                    
#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 Faactory.Jwks@0.1.3
                    
#: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=Faactory.Jwks&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Faactory.Jwks&version=0.1.3
                    
Install as a Cake Tool

JWKS retrieval

A minimal .NET library for retrieving and caching JSON Web Key Sets (JWKS) for JWT validation.

Designed for services that need reliable, in-memory access to signing keys with automatic refresh.

Features

  • Fetch JWKS from HTTP(S) or local sources
  • In-memory caching with periodic refresh
  • Optional local file support for development
  • Resilient HTTP handling (retries, circuit breaker, timeout)

Installation

Install the package from NuGet:

dotnet add package Faactory.Jwks

Usage

Register the JWKS provider in your service collection:

builder.Services.AddJwksProvider( options =>
{
    options.Uri = "https://example.com/jwks.json";
    options.RefreshInterval = TimeSpan.FromMinutes( 30 );
} );

ASP.NET Core Integration

If you're using ASP.NET Core with JWT bearer authentication, you can integrate the JWKS provider directly into token validation.

First, install the integration package:

dotnet add package Faactory.Jwks.AspNetCore

Then register the JWKS provider (same as before) and enable token validation integration:

builder.Services.AddJwksProvider( options =>
{
    options.Uri = "https://example.com/jwks.json";
    options.RefreshInterval = TimeSpan.FromMinutes( 30 );
} );

builder.Services.AddJwksTokenValidation();

This configures JWT bearer authentication to resolve signing keys using the registered JWKS.

Optional: Distributed Cache

If a distributed cache (IDistributedCache) is registered, the provider will:

  • load the last known JWKS on startup (if available)
  • persist refreshed JWKS to the cache

This can help reduce downtime during application restarts if the JWKS endpoint is temporarily unavailable.

No additional configuration is required beyond registering a distributed cache implementation.

Local Development

You can use a local JWKS file instead of an HTTP endpoint:

    builder.Services.AddJwksProvider( options =>
    {
        options.Uri = "/path/to/local/jwks.json";
    } );

Relative paths and ~/ are also supported.

When to Use

Use this library if:

  • you validate JWTs
  • you rely on a JWKS endpoint
  • you want caching and refresh handled for you
Product 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Faactory.Jwks:

Package Downloads
Faactory.Jwks.AspNetCore

ASP.NET Core integration layer for JWKS-based validation

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.3 152 5/12/2026
0.1.2 174 4/23/2026
0.1.1 110 4/22/2026
0.1.0 105 4/22/2026