AuthEndpoints 3.0.0-alpha.11

This is a prerelease version of AuthEndpoints.
There is a newer version of this package available.
See the version list below for details.
dotnet add package AuthEndpoints --version 3.0.0-alpha.11
                    
NuGet\Install-Package AuthEndpoints -Version 3.0.0-alpha.11
                    
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="AuthEndpoints" Version="3.0.0-alpha.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AuthEndpoints" Version="3.0.0-alpha.11" />
                    
Directory.Packages.props
<PackageReference Include="AuthEndpoints" />
                    
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 AuthEndpoints --version 3.0.0-alpha.11
                    
#r "nuget: AuthEndpoints, 3.0.0-alpha.11"
                    
#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 AuthEndpoints@3.0.0-alpha.11
                    
#: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=AuthEndpoints&version=3.0.0-alpha.11&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AuthEndpoints&version=3.0.0-alpha.11&prerelease
                    
Install as a Cake Tool

AuthEndpoints

nuget issues downloads workflow

license

A simple auth library for ASP.NET Core. AuthEndpoints provides minimal API endpoints for registration, email verification, password reset, login/logout, 2FA, JWT, and passkeys (WebAuthn).

swagger_authendpoints

Endpoints

  • Cookie / Bearer Identity (MapCookieAuthEndpoints / MapBearerAuthEndpoints)
    • register, confirm email, login, logout
    • forgot / reset password, account info
    • 2FA manage
    • reauth (confirmIdentity, confirmIdentity/passkeyOptions, manage/authMethods)
  • Simple JWT (MapJwtAuthEndpoints)
    • create (login), refresh, verify
    • when 2FA is enabled, create requires twoFactorCode or twoFactorRecoveryCode
  • Passkeys (MapPasskeyEndpoints)
    • creation / request options
    • passwordless register + login
    • list / add / rename / delete credentials

Installing via NuGet

dotnet add package AuthEndpoints --version 3.0.0-alpha.10

Quick start

// Program.cs
builder.Services
    .AddIdentityApiEndpoints<AppUser>(o =>
    {
        o.Stores.SchemaVersion = IdentitySchemaVersions.Version3; // required for passkeys
    })
    .AddEntityFrameworkStores<AppDbContext>()
    .AddDefaultTokenProviders();

builder.Services.Configure<IdentityPasskeyOptions>(options =>
{
    options.ServerDomain = "example.com"; // your relying-party domain
});

builder.Services.AddJwtEndpoints<AppUser, AppDbContext>(options =>
{
    // Required: set a stable secret (do not leave unset).
    options.SigningOptions.SymmetricKey = builder.Configuration["Jwt:SymmetricKey"];
});

builder.Services.AddAntiforgery();
builder.Services.AddCookieAuthEndpoints(); // ReAuth + login rate limits
builder.Services.AddPasskeyEndpoints();    // passkey rate limits (+ ReAuth if not already added)

var app = builder.Build();

app.UseAuthentication();
app.UseAuthorization();
app.UseRateLimiter();
app.UseAntiforgery();

app.MapGroup("/identity").MapCookieAuthEndpoints<AppUser>();
app.MapGroup("/auth").MapJwtAuthEndpoints<AppUser>();
app.MapGroup("/account").MapPasskeyEndpoints<AppUser>();

app.Run();

Passkey passwordless flow

  1. POST /account/passkeys/register/options with { "email": "..." } → WebAuthn creation options
  2. Browser navigator.credentials.create(...)
  3. POST /account/passkeys/register with { "email": "...", "credentialJson": "..." } → account + passkey

Sign-in after register/login matches Identity password login:

  • Default (no query flags): Identity bearer tokens (AccessTokenResponse)
  • ?useCookies=true: persistent application cookie
  • ?useSessionCookies=true: session application cookie

CSRF (antiforgery) is required on these endpoints for anonymous and cookie-authenticated clients. Bearer-only authenticated calls (Identity bearer or JWT Bearer) may omit the CSRF token on endpoints that use RequireAntiforgery. This does not issue Simple JWT — call /auth/create separately if you use MapJwtAuthEndpoints.

For an existing signed-in user (with reauth): POST /account/passkeys/creationOptions then POST /account/passkeys.

Reauthentication (step-up)

Mapped automatically with cookie/bearer Identity groups:

  1. GET /identity/manage/authMethods — which proofs the user can use (password, authenticator, recoveryCodes, passkeys)
  2. For passkey step-up: POST /identity/confirmIdentity/passkeyOptions → WebAuthn getPOST /identity/confirmIdentity with { "credentialJson": "..." }
  3. Or confirm with exactly one of: password, twoFactorCode, twoFactorRecoveryCode, credentialJson

Success issues a short-lived AuthEndpoints.ReAuth cookie (5 minutes) for endpoints that use RequireReauth().

Documentations

Documentation is available at https://madeyoga.github.io/AuthEndpoints/.

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AuthEndpoints:

Package Downloads
AuthEndpoints.External.OAuth

Minimal API endpoints for external OAuth authentication (GitHub, Google) with ASP.NET Core Identity

GitHub repositories

This package is not used by any popular GitHub repositories.