Changelog
Modules

Identity management

Account lifecycle endpoints — register, confirm, forgot/reset password, manage info and 2FA.

Maps account lifecycle endpoints. Pair with a sign-in module (cookie, bearer, or JWT).

DI

Registered by the facade (AddAuthEndpoints) or manually via Identity API endpoints + EF stores + token providers.

Map

app.MapGroup("/identity").MapIdentityManagementApi<AppUser>();
// Optional: unique confirm email name when mapping twice
// .MapIdentityManagementApi<AppUser>(confirmEmailEndpointName: "BearerConfirmEmail");

Routes

Relative to the group prefix (facade default /identity):

MethodPathNotes
POST/registerCreates user; duplicate email returns 200 OK (no enumeration). Rate-limited.
GET/confirmEmailQuery userId, code, optional changedEmail
POST/resendConfirmationEmailAuth + CSRF + rate limit. Signed-in user only; body email is ignored.
POST/forgotPasswordRate-limited
POST/resetPasswordRate-limited
GET/manage/authMethodsReAuth methods (see ReAuth)
POST/confirmIdentityStep-up proof
POST/confirmIdentity/passkeyOptionsPasskey options for step-up
GET/manage/2fa2FA status
POST/manage/2faEnable/disable 2FA — CSRF + ReAuth
GET/manage/infoCurrent user info
POST/manage/infoUpdate info — CSRF + ReAuth

confirmEmail

Query string on GET /confirmEmail:

QueryRequiredNotes
userIdyesIdentity user id
codeyesConfirmation (or change-email) token from the emailed link
changedEmailnoWhen set, confirms a change to that email and updates the user name

When AuthEndpointsOptions.EmailConfirmation.ConfirmEmailRedirectUri is set, success and failure return 302 to that URI with status and flow instead of the thank-you body or 401. The account mutation still runs first. Leave the option unset for callers that expect 200 or 401. See Configuration.

resendConfirmationEmail

Requires a signed-in user (RequireAuthorization + CSRF). The request body email (ResendConfirmationEmailRequest) is ignored; the handler resends to the signed-in user's email.

Authorization

Management authorize attribute accepts registered schemes among: application cookie, Identity bearer, and JWT bearer.

Sensitive manage mutations require antiforgery and ReAuth.

Gotchas

  • Map management once in production (see Requirements).
  • Production requires a real IEmailSender<TUser> for confirmation and reset emails.
  • Register alone does not sign the user in — use a sign-in module.