TokenInspect.AspNetCore 0.2.0

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

TokenInspect.AspNetCore

Drop-in ASP.NET Core middleware for the Token Inspect plugin. Records, per correlation id:

  • the inbound token (kind, claims, validation result, RBAC decision),
  • outbound HttpClient calls,
  • timestamps and ordering.

Buffered in a bounded in-memory ring with TTL. Exposes a dev endpoint that the browser plugin fetches to merge server lanes with client lanes by correlationId.

Install

dotnet add package TokenInspect.AspNetCore

Basic use

builder.Services.Configure<AspNetCoreOptions>(opts =>
{
    opts.Enabled = !builder.Environment.IsProduction();
    opts.AckExposesTokens = !builder.Environment.IsProduction();
    opts.LoopbackOnly = true;
    opts.Authorize = (ctx, id) => ctx.User?.Identity?.IsAuthenticated == true;
});

var app = builder.Build();
app.UseTokenInspect();        // records on every request
app.MapTokenInspectDev();     // GET /__ti/trace?id=... (gated by Authorize)

In the browser, point the @oidc-token-inspect/browser plugin at the dev endpoint:

init({
  enabled: true,
  ackExposesTokens: true,
  preset: 'api-validates-token',
  egress: { endpoint: '/__ti/trace' },
});

The browser injects a same-origin traceparent header on outgoing calls; the middleware reads it and the panel merges both lanes.

Defaults you should not loosen

  • LoopbackOnly = true. The dev endpoint binds to loopback only. Open it carefully if you must.
  • Authorize = (_, _) => false. The host must provide a real check. Header-trust ACLs are impossible by construction.
  • Enabled = false in production. The two-step opt-in (Enabled plus AckExposesTokens) is a backstop, not the strategy.

Full security model: security.md.

License

MIT.

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

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.2.0 71 6/1/2026
0.1.0 76 5/31/2026