Password Reset Fails with Custom Database Connection Error
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.
- Auth0
- Custom Database Connections
- Flexible Identifiers
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.
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
-
Go to the custom database connection settings.
- Open the getUser script.
- Modify the script to ensure the profile object explicitly includes a
user_id. - Refer to the documented examples for the correct script structure.
- 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.