Remove the “auth0|” prefix of the user ID

Problem statement

Is it possible to remove the “auth0|” prefix of the user ids?

Symptoms

The user ids for Auth0 databases include a prefix “auth0|” that some customers want to avoid sometimes

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 own prefix into 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.