Change a user's email or password
A signed-in user changes their email or password through /auth/manage/info on the password facade. POST requires a CSRF token in the RequestVerificationToken header and a fresh ReAuth proof. The body is Identity's InfoRequest: { "newEmail"?, "newPassword"?, "oldPassword"? }.
Read the account info
Send GET /auth/manage/info. The response is { "email", "isEmailConfirmed" }. This route needs no CSRF token and no ReAuth.
Change the password
- Complete step-up. See Require step-up before sensitive actions.
- Send
POST /auth/manage/infowith{ "oldPassword", "newPassword" }and the CSRF header. - Check the response:
200 { "email", "isEmailConfirmed" }: the password changed.400validation problemOldPasswordRequired: the request hadnewPasswordbut nooldPassword.400validation problemPasswordMismatch:oldPasswordwas wrong. Password-rule failures return their own codes.
A user who forgot the current password uses Reset a forgotten password instead.
Set a first password
An account created from an emailed code, a passkey, or an external login has no password. POST /auth/manage/info cannot add one. Use POST /auth/manage/password.
- Complete step-up. An account with no password, authenticator, or passkey can use an emailed code when email-code step-up is mapped. See Require step-up before sensitive actions.
- Send
POST /auth/manage/passwordwith{ "newPassword" }and the CSRF header. - Check the response:
200with an empty body: the password is set. Password login then works. The security stamp rotates, so other sessions that check the stamp end. The acting cookie session stays signed in and needs a new ReAuth proof for the next sensitive action.400validation problemUserAlreadyHasPassword: the account already has a password. Change it withPOST /auth/manage/info.400validation problemPasswordRequired:newPasswordwas missing or empty. Password-rule failures return their own codes.404: password sign-in is not mapped, so this host has no password login to use the new password.
MapPasswordAuth, MapAccountManagementEndpoints, and MapIdentityManagementApi map this route. The notice goes through IAccountSecurityEmailSender<TUser>. The default implementation only logs. Register an implementation to send the mail. The password is not included.
Change the email
- Complete step-up.
- Send
POST /auth/manage/infowith{ "newEmail" }and the CSRF header. - The response is
200and still shows the old email. AuthEndpoints sends a change-email link to the new address throughIEmailSender<TUser>.SendConfirmationLinkAsync. - The user opens the link:
GET /auth/confirmEmail?userId=...&code=...&changedEmail=.... The email and the user name change only now. - With
EmailConfirmation.ConfirmEmailRedirectUriset, the link redirects withflow=change-emailandstatus=confirmedorstatus=failed. Without it, the link returns200text or401.
An invalid newEmail returns a 400 validation problem InvalidEmail. You can send newEmail and newPassword in one request. AuthEndpoints changes the password first.
Know the limits
POST /auth/manage/infocannot set a first password on an account that has none. It returnsOldPasswordRequired. UsePOST /auth/manage/passwordwhen password sign-in is mapped.- No endpoint deletes an account.