AuthEndpoints: authentication library for ASP.NET Core Identity
Ready-made sign-up and sign-in endpoints for ASP.NET Core Identity: passwords, passkeys, email codes, OAuth, and 2FA.
Free and MIT licensed · No account or hosted service · Runs on your own database
Confused by ASP.NET Core auth?
Writing code is cheap now. Bugs aren't. Shared code is still the fastest way to get fewer of them, and AuthEndpoints is that shared code for auth.
dotnet add package AuthEndpoints
Program.cs
builder.Services.AddDbContext<AppDbContext>(/* your provider */);builder.Services.AddPasswordAuth<AppUser, AppDbContext>(o =>{o.Passkeys.ServerDomain = "example.com";});var app = builder.Build();app.UseAuthEndpoints();app.MapPasswordAuth<AppUser>();
Mapped for you
- POST/auth/register
- POST/auth/login
- POST/auth/logout
- GET/auth/confirmEmail
- POST/auth/forgotPassword
- POST/auth/resetPassword
- POST/auth/manage/2fa
- + more password auth routes
Cookie session by default · JWT via AuthEndpointsSession.Jwt
What AuthEndpoints can do
Each capability links to the guide that shows you how to use it.
Start with password sign-in
The quick start uses AddPasswordAuth and MapPasswordAuth. Pick another setup when you need JWT, passkeys, an emailed code, or an external provider.