Skip to content

Repository files navigation

AuthEndpoints

nuget issues downloads workflow license

AuthEndpoints is an ASP.NET Core library of ready-made auth API endpoints on top of Identity. It fits a first-party auth API for web and mobile clients (React, Next.js, Vue, Nuxt, Svelte, native apps, and similar) with email/password, cookies, JWT, and/or passkeys.

  • Ready-made endpoints for registration, login, password reset, 2FA, and session/token flows
  • Opinionated quick start with AddAuthEndpoints / UseAuthEndpoints / MapAuthEndpoints
  • Account lifecycle: register, confirm email, forgot/reset password, manage info and 2FA, step-up ReAuth
  • Sign-in stacks you choose: cookie sessions, Identity bearer tokens, or Simple JWT
  • Passkeys (WebAuthn) for passwordless register and login
  • Built-in hardening: rate limiting, antiforgery, lockout-aware login, hashed JWT refresh tokens with reuse detection
  • Optional package AuthEndpoints.External.OAuth for GitHub/Google OAuth

Getting started

Requires .NET 10, ASP.NET Core Identity, and EF Core.

dotnet add package AuthEndpoints
builder.Services.AddDbContext<AppDbContext>(/* your provider */);

builder.Services.AddAuthEndpoints<AppUser, AppDbContext>(o =>
{
    o.Passkeys.ServerDomain = "example.com"; // required in Production
});

builder.Services.AddTransient<IEmailSender<AppUser>, MyEmailSender>();

var app = builder.Build();

app.UseAuthEndpoints();
app.MapAuthEndpoints<AppUser>();

app.Run();

Documentation

For configuration, composable modules, route tables, and production guidance, see the AuthEndpoints documentation.

AI agents

Add the coding-agent skill from this repository:

npx skills add madeyoga/AuthEndpoints

This does not install the NuGet package. Add that with dotnet add package AuthEndpoints. See AI agents.

Contribute

Issues and pull requests are welcome. Open an issue at madeyoga/AuthEndpoints to report bugs or propose changes.

License

This project is licensed under the MIT License.

About

A composable authentication endpoints library for aspnetcore.

Topics

Resources

Security policy

Stars

119 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages