Nedo.AspNet.Authentication.Abstractions
2.0.0
See the version list below for details.
dotnet add package Nedo.AspNet.Authentication.Abstractions --version 2.0.0
NuGet\Install-Package Nedo.AspNet.Authentication.Abstractions -Version 2.0.0
<PackageReference Include="Nedo.AspNet.Authentication.Abstractions" Version="2.0.0" />
<PackageVersion Include="Nedo.AspNet.Authentication.Abstractions" Version="2.0.0" />
<PackageReference Include="Nedo.AspNet.Authentication.Abstractions" />
paket add Nedo.AspNet.Authentication.Abstractions --version 2.0.0
#r "nuget: Nedo.AspNet.Authentication.Abstractions, 2.0.0"
#:package Nedo.AspNet.Authentication.Abstractions@2.0.0
#addin nuget:?package=Nedo.AspNet.Authentication.Abstractions&version=2.0.0
#tool nuget:?package=Nedo.AspNet.Authentication.Abstractions&version=2.0.0
Nedo.AspNet.Authentication
A modular authentication platform for ASP.NET Core. Six SPA-friendly social providers (Google, Microsoft, Apple, GitHub, Facebook, Keycloak) that mint your own JWTs · four enterprise OIDC providers (Keycloak, Entra ID, Auth0, Okta) for the JWT-bearer pattern · Local username/password with refresh-token families, email verification, password reset, account management · TOTP 2FA that auto-gates every sign-in path · dev-only impersonation endpoint · multi-tenant resolution. All composable NuGet packages.
Authentication only — verifies who the caller is. Authorization (what the caller can do) is handled separately.
Architecture
Nedo.AspNet.Authentication
├── Core
│ ├── Abstractions Zero-dependency contracts (IAuthContext, IAuthEventSink, AuthMode)
│ ├── Authentication JWT Bearer, middleware, DI engine
│ ├── TokenManagement Token forwarding + client-credentials refresh
│ └── Claims Claims transformation pipeline
│
├── Local
│ └── Local Username/password, refresh-token families with reuse detection,
│ email verify, password reset, external-login linking,
│ account management endpoints, AuthOutcome discriminated outcome,
│ 5 focused services (Login / Registration / ExternalSignIn /
│ PasswordReset / EmailVerification) sharing SessionTokenIssuer
│
├── Shared OIDC plumbing
│ └── Oidc OidcIdTokenValidatorBase + OAuthCodePopupEndpoints helper,
│ reused by every social provider
│
├── Social Identity Providers (each issues Nedo JWTs after upstream verification)
│ ├── Google OIDC ID-token exchange (Google Identity Services)
│ ├── Microsoft OIDC ID-token exchange (MSAL.js, consumers/work/multi-tenant)
│ ├── Apple OIDC ID-token exchange (Apple JS SDK)
│ ├── GitHub OAuth code exchange (popup + postMessage)
│ ├── Facebook Graph API access-token verification (FB JS SDK)
│ └── Keycloak (SignIn) OAuth code exchange via AddKeycloakSignIn
│
├── Enterprise Identity Providers (your API as resource server, validates upstream JWTs)
│ ├── Keycloak (Bearer) realm_access roles, resource_access (AddKeycloak)
│ ├── EntraId Azure AD app roles, group mapping
│ ├── Auth0 Namespace-prefixed claims, RBAC
│ └── Okta Authorization server, groups → roles
│
├── Security extensions
│ ├── Totp TOTP 2FA (RFC 6238) — auto-gates every sign-in path via IMultiFactorChallenge
│ └── Dev Dev-only POST /auth/dev/sign-in (refuses outside Development env)
│
└── Cross-Cutting
├── MultiTenant Tenant resolution (header, claim, subdomain)
└── Diagnostics Circuit breaker, IdP health check
Quick Start
dotnet add package Nedo.AspNet.Authentication
using Nedo.AspNet.Authentication;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddNedoAuthentication(options =>
{
options.Authority = "https://keycloak.example.com/realms/my-realm";
options.Audience = "my-api";
});
var app = builder.Build();
app.UseAuthentication();
app.UseNedoAuthContext();
app.UseAuthorization();
app.MapGet("/me", (IAuthContext auth) => Results.Ok(new
{
auth.UserId,
auth.Email,
auth.Roles,
auth.TenantId
}));
app.Run();
Documentation
Start at docs/README.md for a task-oriented index.
| Section | Pointers |
|---|---|
| Get started | 01 — Overview · 02 — Getting Started · 03 — Core Concepts |
| Add a sign-in provider | 09 — Local (username/password + refresh families + email-verify + password-reset + account management) · providers/social/ (Google, Microsoft, Apple, GitHub, Facebook, Keycloak — each guide includes console-registration walkthrough) · 04 — Enterprise OIDC (Keycloak/Entra/Auth0/Okta as resource server) |
| Security on top of Local | TOTP 2FA (auto-gates every sign-in path) · Dev-auth (no-password endpoint for local dev + tests) |
| Frontend integration | React + Local + social sample · React + Keycloak · Mobile |
| Reference | 05 — Claims · 06 — Tokens · 07 — Multi-Tenant · 08 — Diagnostics |
| Operations | 10 — Testing · 11 — Migration |
For a runnable end-to-end example of Local + all six social providers + 2FA + dev-auth driving a React SPA, see sample/Nedo.AspNet.Authentication.Local.Sample (.NET API) and sample/Nedo.AspNet.Authentication.Local.Sample.React (Vite + React + TypeScript).
Build & Test
dotnet build
dotnet test # 91 tests
dotnet run --project sample/Nedo.AspNet.Authentication.Sample
Releasing
All 20 packages are published together on every v* git tag via .gitlab-ci.yml. See PUBLISHING.md for the operator runbook (version flow, required CI/CD variables, dry-run instructions, common failure modes).
git tag v1.2.0
git push origin v1.2.0 # → GitLab builds + pushes all 20 to nuget.org
License
MIT
| 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
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Nedo.AspNet.Authentication.Abstractions:
| Package | Downloads |
|---|---|
|
Nedo.AspNet.Authentication
ASP.NET Core authentication engine — JWT Bearer, middleware, DI wiring, and authorization. |
|
|
Nedo.AspNet.Authentication.Claims
Claims transformation and normalization pipeline for Nedo authentication. |
|
|
Nedo.AspNet.Authentication.MultiTenant
Multi-tenant authentication support — tenant resolution and isolation strategies. |
GitHub repositories
This package is not used by any popular GitHub repositories.