AuthEndpoints is an authentication library for ASP.NET Core Identity that gives you ready-made login, register, refresh, 2FA, passkey and password reset endpoints. It is for your own web and mobile clients. You keep ASP.NET Core Identity, your user type, and your database. Built for first-party SPAs, mobile apps, and APIs.
- Cookie sessions for browser apps, and JWT bearer sessions with refresh for token clients
- Two-factor authentication, passkeys (WebAuthn), and email-code sign-in
- Account lifecycle: register, confirm email, reset password, manage account, and step-up ReAuth
- Hardening: rate limits, antiforgery, lockout-aware login, and refresh-token reuse detection
- GitHub and Google sign-in. See External OAuth
MapIdentityApi maps one fixed set of Identity API endpoints. AuthEndpoints covers register, login, refresh, and password reset, and adds cookie sessions, JWT bearer sessions, passkeys, logout, and a choice of which routes to map.
The route-by-route comparison is in AuthEndpoints compared with MapIdentityApi.
Requires .NET 10, ASP.NET Core Identity, and EF Core.
dotnet add package AuthEndpointsbuilder.Services.AddDbContext<AppDbContext>(/* your provider */);
builder.Services.AddPasswordAuth<AppUser, AppDbContext>(o =>
{
o.Passkeys.ServerDomain = "example.com"; // omit to leave passkeys off
});
builder.Services.AddTransient<IEmailSender<AppUser>, MyEmailSender>();
var app = builder.Build();
app.UseAuthEndpoints();
app.MapPasswordAuth<AppUser>();
app.Run();This maps register, login, logout, email confirmation, password reset, ReAuth, and account management (/auth/manage/info, /auth/manage/2fa, /auth/manage/password) under /auth, plus passkeys under /auth/passkeys when ServerDomain is set; see the endpoint reference for every route.
Guides, route tables, and production setup are at https://authendpoints.harten.id.
Add the coding-agent skill from this repository:
npx skills add madeyoga/AuthEndpointsSee AI agents.
Issues and pull requests are welcome. Read CONTRIBUTING.md first, and look for issues labeled good first issue to get started.
This project is licensed under the MIT License.
