Nedo.AspNet.Authentication.Oidc
2.0.9
dotnet add package Nedo.AspNet.Authentication.Oidc --version 2.0.9
NuGet\Install-Package Nedo.AspNet.Authentication.Oidc -Version 2.0.9
<PackageReference Include="Nedo.AspNet.Authentication.Oidc" Version="2.0.9" />
<PackageVersion Include="Nedo.AspNet.Authentication.Oidc" Version="2.0.9" />
<PackageReference Include="Nedo.AspNet.Authentication.Oidc" />
paket add Nedo.AspNet.Authentication.Oidc --version 2.0.9
#r "nuget: Nedo.AspNet.Authentication.Oidc, 2.0.9"
#:package Nedo.AspNet.Authentication.Oidc@2.0.9
#addin nuget:?package=Nedo.AspNet.Authentication.Oidc&version=2.0.9
#tool nuget:?package=Nedo.AspNet.Authentication.Oidc&version=2.0.9
Nedo.AspNet.Authentication.Oidc
Shared OIDC plumbing reused by every social provider (Google, Microsoft, Apple, GitHub, Facebook, Keycloak). Provides:
OidcIdTokenValidatorBase— the cached-JWKS + standard-OIDC-validation base class every ID-token-exchange provider derives from.OAuthCodePopupEndpoints— helper for the/start+/callback+postMessage-back-to-opener pattern that GitHub-style backend OAuth flows use.
Install
dotnet add package Nedo.AspNet.Authentication.Oidc
You usually don't install this directly — it ships transitively with each social-provider package. Reference it on its own only if you're building a new social provider.
Building a new social provider
public class MyOidcValidator : OidcIdTokenValidatorBase
{
public MyOidcValidator(IHttpClientFactory http, IMemoryCache cache)
: base(http, cache,
issuer: "https://my-idp.example.com",
audience: "my-client-id",
jwksUri: "https://my-idp.example.com/.well-known/jwks.json",
cacheKey: "my-idp-jwks")
{ }
// Override hooks here if your IdP needs custom validation (e.g. nonce, custom claim shape).
}
Then map an endpoint that consumes an ID token from the SPA's IdP SDK and exchanges it for a Nedo session via ExternalSignInService.SignInExternalAsync. The six shipped social providers are good worked examples — see their source on GitHub.
Why factor this out
OIDC validation has a lot of boring-but-critical correctness — JWKS caching with key rotation, audience + issuer + lifetime + nonce checks, clock-skew tolerance, signature-algorithm allow-listing, etc. Doing it once + reusing across providers means the security review only happens in one place.
Related
| Package | Built on this |
|---|---|
Nedo.AspNet.Authentication.Google |
ID-token exchange |
Nedo.AspNet.Authentication.Microsoft |
ID-token exchange |
Nedo.AspNet.Authentication.Apple |
ID-token exchange |
Nedo.AspNet.Authentication.GitHub |
OAuth code popup |
Nedo.AspNet.Authentication.Keycloak |
OAuth code popup |
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net9.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 8.0.1)
- System.IdentityModel.Tokens.Jwt (>= 8.0.1)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Nedo.AspNet.Authentication.Oidc:
| Package | Downloads |
|---|---|
|
Nedo.AspNet.Authentication.Google
Google sign-in (ID-token exchange) for Nedo.AspNet.Authentication. |
|
|
Nedo.AspNet.Authentication.Microsoft
Microsoft sign-in (ID-token exchange) for Nedo.AspNet.Authentication. |
|
|
Nedo.AspNet.Authentication.GitHub
GitHub sign-in (OAuth code-exchange) for Nedo.AspNet.Authentication. |
|
|
Nedo.AspNet.Authentication.Keycloak
Keycloak OIDC authentication provider for Nedo.AspNet.Authentication. |
|
|
Nedo.AspNet.Authentication.Apple
Sign in with Apple (ID-token exchange) for Nedo.AspNet.Authentication. |
GitHub repositories
This package is not used by any popular GitHub repositories.