JwtLens 0.1.0
dotnet add package JwtLens --version 0.1.0
NuGet\Install-Package JwtLens -Version 0.1.0
<PackageReference Include="JwtLens" Version="0.1.0" />
<PackageVersion Include="JwtLens" Version="0.1.0" />
<PackageReference Include="JwtLens" />
paket add JwtLens --version 0.1.0
#r "nuget: JwtLens, 0.1.0"
#:package JwtLens@0.1.0
#addin nuget:?package=JwtLens&version=0.1.0
#tool nuget:?package=JwtLens&version=0.1.0
JwtLens
JWT inspection and diagnostics middleware for ASP.NET Core. JwtLens is part of the Lens family for .NET.
Features
- Captures inbound JWT bearer tokens from ASP.NET Core requests.
- Captures outbound JWT bearer tokens from
HttpClientcalls through a delegating handler. - Decodes JWT headers and payload claims without validating or storing secrets.
- Flags expired tokens, tokens nearing expiration, unsigned tokens, and weak algorithms.
- Redacts sensitive claim values before storage.
- Tracks claim changes for repeated subjects.
- Supports environment-guarded registration for safe development-only usage.
Installation
dotnet add package JwtLens
Quick start
using JwtLens.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddJwtLens();
var app = builder.Build();
app.UseJwtLens();
app.Run();
Environment-guarded setup
Use the environment-aware overload to register JwtLens only in selected environments:
builder.Services.AddJwtLens(builder.Environment, options =>
{
options.AllowedEnvironments.Add("Development");
});
var app = builder.Build();
app.UseJwtLens();
When the current environment is not allowed, service registration is skipped and UseJwtLens() is a no-op.
Outbound token capture
Register the JwtLens delegating handler on named or typed HttpClient instances:
builder.Services.AddHttpClient("api")
.AddHttpMessageHandler<JwtLensDelegatingHandler>();
Configuration
builder.Services.AddJwtLens(options =>
{
options.IsEnabled = true;
options.CaptureInboundTokens = true;
options.CaptureOutboundTokens = true;
options.WarnIfExpiresWithin = TimeSpan.FromMinutes(5);
});
Security notes
JwtLens is intended for local development, diagnostics, and controlled non-production environments. Avoid enabling token capture in production unless you have reviewed the data handling, redaction, access control, and retention implications for your application.
Project
Source: https://github.com/AnilOptimizely/HttpLens/tree/main/src/JwtLens
| 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 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. |
-
net10.0
- Lens.Abstractions (>= 0.1.0)
-
net8.0
- Lens.Abstractions (>= 0.1.0)
-
net9.0
- Lens.Abstractions (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 139 | 6/21/2026 |
| 0.0.1-placeholder | 117 | 5/16/2026 |