Nedo.AspNet.Authentication 2.0.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nedo.AspNet.Authentication --version 2.0.6
                    
NuGet\Install-Package Nedo.AspNet.Authentication -Version 2.0.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nedo.AspNet.Authentication" Version="2.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nedo.AspNet.Authentication" Version="2.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Nedo.AspNet.Authentication" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nedo.AspNet.Authentication --version 2.0.6
                    
#r "nuget: Nedo.AspNet.Authentication, 2.0.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nedo.AspNet.Authentication@2.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nedo.AspNet.Authentication&version=2.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Nedo.AspNet.Authentication&version=2.0.6
                    
Install as a Cake Tool

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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
2.0.9 319 5/11/2026
2.0.8 302 5/6/2026
2.0.7 298 5/5/2026
2.0.6 306 5/5/2026
2.0.4 309 5/4/2026
2.0.3 309 5/4/2026
2.0.2 310 5/2/2026
2.0.1 287 5/2/2026
2.0.0 282 5/1/2026