Changelog
Getting Started

Configuration

Reference for AuthEndpointsOptions and nested passkey, JWT, and email confirmation settings.

Configure the facade via AddAuthEndpoints<TUser, TContext>(…) or, with roles, AddAuthEndpoints<TUser, TRole, TContext>(…).

AuthEndpointsOptions

PropertyDefaultDescription
IdentityPath/identityRoute prefix for Identity management plus the configured sign-in stack
SignInCookieAuthEndpointsSignIn.Cookie or IdentityBearer. Pass IdentityBearer as the first argument to AddAuthEndpoints, or set o.SignIn.
PasskeyPath/accountRoute prefix for passkey endpoints
RequireConfirmedAccounttrueIdentity requires a confirmed account before sign-in
Passkeys(enabled)Nested passkey options
EmailConfirmation(unset)Nested email confirmation
Jwt(disabled)Nested JWT options
ConfigureIdentitynullOptional Action<IdentityOptions> applied after secure defaults
ConfigurePasskeysnullOptional Action<IdentityPasskeyOptions> after ServerDomain is applied
RequireEmailSenderInProductiontrueProduction must register a real IEmailSender<TUser> (not Identity's no-op)

Passkeys

AuthEndpointsPasskeyOptions:

PropertyDefaultDescription
EnabledtrueWhen false, passkey DI and mapping are skipped
ServerDomainnullWebAuthn relying-party domain (e.g. example.com). Required in Production when enabled

Email confirmation

AuthEndpointsEmailConfirmationOptions:

PropertyDefaultDescription
ConfirmEmailRedirectUrinullAfter browser GET confirm-email, redirect here instead of the plain-text / 401 response. Absolute https:// (or http:// in Development), or a rooted path such as /auth/email-confirmed.
AllowedRedirectOriginsemptyOrigins such as https://app.example.com required when the redirect URI is absolute. A rooted path does not need an entry.

URI rules:

  • Protocol-relative (//…) and non-http(s) schemes are rejected.
  • A rooted path is resolved against the request public origin (scheme://host, including port). PathBase is not included.
  • An absolute URI must match an allowlist entry on scheme, host, and optional port (origin only).
  • Absolute URI plus an empty allowlist is refused at request time. Production also fails options validation.
  • Absolute http:// is refused unless the host is Development. Production fails options validation for http://.

Every redirect overwrites (does not append) these query parameters:

NameValues
statusconfirmed or failed
flowconfirm when changedEmail is absent; change-email when it is present

The redirect query does not include tokens, user ids, or emails.

SPA signup that stays logged out until confirm: Register a confirmed account.

JWT

AuthEndpointsJwtOptions:

PropertyDefaultDescription
EnabledfalseWhen true, registers and maps JWT endpoints
Path/authRoute prefix for JWT endpoints
ConfigurenullOptional Action<SimpleJwtOptions> for issuer, audience, signing, lifetimes

SimpleJwtOptions (via Jwt.Configure)

Common settings:

PropertyNotes
Issuer / AudienceProduction rejects the library defaults (Jwt / JwtAudience)
AccessTokenLifetimeDefault 15 minutes
SigningOptionsSymmetric (key ≥ 32 UTF-8 bytes), RSA, ECDSA, or X509
TokenValidationParametersOptional override of validation parameters

When JWT is enabled, call modelBuilder.UseRefreshToken() on your DbContext and migrate.

Example

builder.Services.AddAuthEndpoints<AppUser, AppDbContext>(o =>
{
    o.IdentityPath = "/auth/cookie";
    o.PasskeyPath = "/auth/passkey";
    o.RequireConfirmedAccount = true;
    o.Passkeys.ServerDomain = "example.com";
    o.ConfigureIdentity = identity =>
    {
        identity.Password.RequiredLength = 10;
    };
    o.Jwt.Enabled = true;
    o.Jwt.Path = "/auth/jwt";
    o.Jwt.Configure = jwt =>
    {
        jwt.Issuer = "https://example.com";
        jwt.Audience = "https://example.com";
        jwt.SigningOptions.SymmetricKey = builder.Configuration["Jwt:SymmetricKey"];
    };
});

For advanced stacks that skip the facade, see Composable endpoint requirements.