How to require users imported through the Management API to change their password the first time they log in?

I imported a batch of password users through the management API, and the user can log in normally by entering the password, but I have a question, how do I ask the user to change the password when they log in for the first time? Also, when the password has not been changed for a long time (configurable), how do you ask the user to change the password?

Hi,

You can use Actions and Forms to achieve this. There is a user profile field called last_password_reset. You can validate whether the user has performed a password reset within a certain number of days, such as 90 days. If yes, you can allow the user to proceed. If not, you can use Forms to display a message prompting the user to reset their password.

You can use Auth0 Forms to trigger password reset email as well.

Flow

  1. Check if the user has reset their password recently, or within a certain number of days.
  • If yes, allow the user to proceed.
  • If no, use Auth0 Forms to prompt the user to enter their email and call the password reset endpoint in the backend.
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.