Remove the "auth0|" prefix of the user ids

Problem statement

The user ids for Auth0 databases include the prefix “auth0|”. We want to remove the prefix.

Cause

The user_id property is guaranteed to be unique (within a tenant) per user in the format {identity provider id}|{unique id in the provider}. There are ways to create users that will accept a user ID, such as via Management API, Bulk Import, or a Custom DB, but Auth0 will add the prefix to it anyway: auth0|<user_id>:

Solution

You can add your prefix to the user id for custom database connections through the scripts of the connection. If you need an identifier in a specific format for integrating with external systems, a good approach would be to save it in the user’s app_metadata.