TokenInspect.AspNetCore
0.2.0
dotnet add package TokenInspect.AspNetCore --version 0.2.0
NuGet\Install-Package TokenInspect.AspNetCore -Version 0.2.0
<PackageReference Include="TokenInspect.AspNetCore" Version="0.2.0" />
<PackageVersion Include="TokenInspect.AspNetCore" Version="0.2.0" />
<PackageReference Include="TokenInspect.AspNetCore" />
paket add TokenInspect.AspNetCore --version 0.2.0
#r "nuget: TokenInspect.AspNetCore, 0.2.0"
#:package TokenInspect.AspNetCore@0.2.0
#addin nuget:?package=TokenInspect.AspNetCore&version=0.2.0
#tool nuget:?package=TokenInspect.AspNetCore&version=0.2.0
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 = falsein production. The two-step opt-in (EnabledplusAckExposesTokens) is a backstop, not the strategy.
Full security model: security.md.
License
MIT.
| 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. |
-
net10.0
- TokenInspect (>= 0.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.