Toamaisutaa.OpenIdConnect
0.5.0
dotnet add package Toamaisutaa.OpenIdConnect --version 0.5.0
NuGet\Install-Package Toamaisutaa.OpenIdConnect -Version 0.5.0
<PackageReference Include="Toamaisutaa.OpenIdConnect" Version="0.5.0" />
<PackageVersion Include="Toamaisutaa.OpenIdConnect" Version="0.5.0" />
<PackageReference Include="Toamaisutaa.OpenIdConnect" />
paket add Toamaisutaa.OpenIdConnect --version 0.5.0
#r "nuget: Toamaisutaa.OpenIdConnect, 0.5.0"
#:package Toamaisutaa.OpenIdConnect@0.5.0
#addin nuget:?package=Toamaisutaa.OpenIdConnect&version=0.5.0
#tool nuget:?package=Toamaisutaa.OpenIdConnect&version=0.5.0
Toamaisutaa.OpenIdConnect
Bearer token validation for Toamaisutaa. This is the resource-server half: it validates the tokens your identity provider issues, and signs the ones local password login issues, so that nothing downstream can tell the two apart.
builder.Services.AddToamaisutaaBearer(builder.Configuration); // section "Oidc"
app.UseAuthentication();
{
"Oidc": {
"Authority": "https://id.example.com/realms/main",
"ClientId": "your-api",
"RoleClaim": "roles"
}
}
Every endpoint comes from the issuer's discovery document, so Keycloak, Authentik, Pocket ID, Okta and Entra are a configuration change rather than a code change.
What it does beyond the defaults
MapInboundClaimsis off, always. Claims keep the names the issuer gave them, sosubissuband not a SOAP-era URI that only matches by accident.- Userinfo enrichment, for issuers that keep group membership out of the access token entirely. Off unless configured.
- 403s that explain themselves. Every refusal logs which claim was read, what the token actually carried there, and every claim type present. An empty 403 with a valid token is a miserable afternoon; this is the fix.
- Query-string tokens for named paths, because SignalR's browser transport cannot set a header. Opt-in per path prefix rather than globally.
This package does not perform an interactive login. It is a resource server: the browser gets its tokens from the identity provider, and this validates them.
Pair it with Toamaisutaa.AspNetCore for authorization policies, ICurrentUser and the endpoints.
Documentation
OIDC bearer validation - docs.toamaisutaa.pianonic.ch
Licensed under PolyForm Noncommercial 1.0.0 - free for noncommercial use; commercial use needs a separate licence.
| 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
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.10)
- Toamaisutaa.Core (>= 0.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Toamaisutaa.OpenIdConnect:
| Package | Downloads |
|---|---|
|
Toamaisutaa.AspNetCore
ASP.NET Core integration for Toamaisutaa: the authenticated-by-default authorization policy, ICurrentUser, the runtime OIDC configuration endpoint a SPA reads at startup, and the local username and password sign-in endpoints. |
GitHub repositories
This package is not used by any popular GitHub repositories.