Nedo.AspNet.Authentication
2.0.3
See the version list below for details.
dotnet add package Nedo.AspNet.Authentication --version 2.0.3
NuGet\Install-Package Nedo.AspNet.Authentication -Version 2.0.3
<PackageReference Include="Nedo.AspNet.Authentication" Version="2.0.3" />
<PackageVersion Include="Nedo.AspNet.Authentication" Version="2.0.3" />
<PackageReference Include="Nedo.AspNet.Authentication" />
paket add Nedo.AspNet.Authentication --version 2.0.3
#r "nuget: Nedo.AspNet.Authentication, 2.0.3"
#:package Nedo.AspNet.Authentication@2.0.3
#addin nuget:?package=Nedo.AspNet.Authentication&version=2.0.3
#tool nuget:?package=Nedo.AspNet.Authentication&version=2.0.3
Nedo.AspNet.Authentication
The core of the modular auth platform: JWT Bearer middleware, the DI engine that wires every provider together, the AuthContext that fronts HttpContext.User for clean DI, and the authorization plumbing every other package builds on.
Install
dotnet add package Nedo.AspNet.Authentication
This package is referenced transitively by every provider package — install it directly only when you want to consume the framework without a specific identity provider (e.g. you're issuing JWTs from another service and just want this app to validate them as a resource server).
Quickstart — resource-server mode (validate someone else's JWTs)
using Nedo.AspNet.Authentication;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAuthentication("Bearer")
.AddJwtBearer(opts =>
{
opts.Authority = "https://your-issuer.example.com";
opts.Audience = "your-api";
});
builder.Services.AddAuthorization();
builder.Services.AddHttpContextAccessor();
builder.Services.AddScoped<IAuthContext, AuthContext>();
var app = builder.Build();
app.UseAuthentication();
app.UseNedoAuthContext(); // populates IAuthContext from HttpContext.User
app.UseAuthorization();
app.MapGet("/me", (IAuthContext auth) => new { auth.UserId, auth.Email });
app.Run();
Quickstart — issue your own JWTs
For username/password + refresh tokens, use Nedo.AspNet.Authentication.Local (which references this package and adds the issuer + EF persistence).
For social providers (Google, Microsoft, Apple, GitHub, Facebook, Keycloak), pair this with one of the Nedo.AspNet.Authentication.{Provider} packages.
What's in here
| Type | Purpose |
|---|---|
AuthContext |
Default IAuthContext implementation reading HttpContext.User. |
AuthContextMiddleware |
Populates IAuthContext after authentication runs. Wire with app.UseNedoAuthContext(). |
NedoAuthorizationPolicy |
Helpers for the [Authorize] policy surface. |
| Extension methods | AddNedoAuth*, MapNedo* — surfaced by every provider package. |
Architecture & docs
- Library overview
- Getting started
- Core concepts —
IAuthContext,AuthMode, middleware pipeline, error handling
Related packages
| Goal | Package |
|---|---|
| Username/password + refresh tokens | Nedo.AspNet.Authentication.Local |
| Passkeys / WebAuthn on top of Local | Nedo.AspNet.Authentication.Local.Passkeys |
| Social sign-in (mints your own JWTs) | Nedo.AspNet.Authentication.{Google,Microsoft,Apple,GitHub,Facebook,Keycloak} |
| Enterprise OIDC (validate external JWTs) | Nedo.AspNet.Authentication.{Keycloak,EntraId,Auth0,Okta} |
| TOTP 2FA gating every sign-in path | Nedo.AspNet.Authentication.Totp |
| Forwarding access tokens to downstream APIs | Nedo.AspNet.Authentication.TokenManagement |
| Multi-tenant resolution | Nedo.AspNet.Authentication.MultiTenant |
| Diagnostics / circuit breaker / health | Nedo.AspNet.Authentication.Diagnostics |
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.AspNetCore.Authentication.JwtBearer (>= 9.0.0)
- Nedo.AspNet.Authentication.Abstractions (>= 2.0.3)
NuGet packages (14)
Showing the top 5 NuGet packages that depend on Nedo.AspNet.Authentication:
| Package | Downloads |
|---|---|
|
Nedo.AspNet.Authentication.Local
Local username/password authentication for Nedo.AspNet.Authentication with EF Core persistence. |
|
|
Nedo.AspNet.Authentication.Totp
TOTP (RFC 6238) two-factor authentication for Nedo.AspNet.Authentication.Local. Compatible with Google Authenticator, Microsoft Authenticator, 1Password, Authy, etc. |
|
|
Nedo.AspNet.Authentication.Auth0
Auth0 authentication provider for Nedo.AspNet.Authentication. |
|
|
Nedo.AspNet.Authentication.Google
Google sign-in (ID-token exchange) for Nedo.AspNet.Authentication. |
|
|
Nedo.AspNet.Authentication.Dev
Dev-only impersonation endpoint — sign in as any user without a password. Refuses to start outside the Development environment unless explicitly forced. |
GitHub repositories
This package is not used by any popular GitHub repositories.