Remove the "auth0|" Prefix of the User ID

Last Updated: Nov 13, 2024

Overview

The user ids for Auth0 databases include a prefix “auth0|” that some customers want to avoid sometimes. Is it possible to remove the “auth0|” prefix of the user ids?

Applies To

  • User ID
  • App metadata

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.