Password Reset Fails with Custom Database Connection Error

Overview

This article describes an issue where a password reset fails in a tenant that uses a custom database connection. The user interface does not display the Requires Username toggle; instead, it shows an Attributes tab. During the password reset attempt, the following error occurs:

 

DB get_user Custom script: id is required, please update the import user script in the connection settings.

 

Applies To
  • Auth0
  • Custom Database Connections
  • Flexible Identifiers
Cause

The New Attributes Configuration (Flexible Identifiers) feature is active on the tenant. When this feature is enabled, the system enforces stricter validation. The custom database script must explicitly return a user_id in the profile object to generate the password change ticket and associate it with a specific identity.

Solution

To resolve this issue, update the script to meet the strict validation requirements, or revert the connection to the legacy configuration.

Update the Custom Database Script

  1. Go to the custom database connection settings.

  2. Open the getUser script.
  3. Modify the script to ensure the profile object explicitly includes a user_id.
  4. Refer to the documented examples for the correct script structure.
  5. Enter a unique string for the user_id, such as the example provided below:
function getUser (email, callback) {
  return callback(null, {
    user_id: 'legacy_' + email,
    email: email
  });
}

NOTE: This is an example for illustrative purposes; the user should first test it in a development environment.

Revert to the Legacy Configuration

To restore the legacy configuration, here is a guide on how to disable the Flexible Identifiers feature using the Management API.

 

    Related References

    Recommended content

    No recommended content found...