Changing user_id Value for Custom Database Users

Overview

This article explains whether it is possible to migrate the user_id value for users to new values when the user logs in for a custom database user.

Applies To
  • Custom Database
  • Changing user_id
Solution

While it is not possible to change the user_id value of an existing custom database user, it is possible to delete their profiles in Auth0. Change the way the custom database script assigns the user_id value, and the next time they log in, a new account will be created for them with a new user_id. 

These deleted users would not have valid sessions with Auth0. However, it would be up to the application's session logic to determine if they are still considered logged in from the perspective of the application.

Depending on how the users' sessions are tracked, it might be desirable to remove their sessions and redirect them to the Auth0 login page to log in again in order to create a new authenticated session.

Recommended content

No recommended content found...