Default User ID Prefix Cannot Be Modified
Last Updated:
Overview
This article explains why the prefix for a user_id cannot be changed from its default value. This addresses situations where a user attempts to create a custom user_id format without the connection strategy prefix.
Applies To
- Custom User ID
- User ID format
Cause
The user_id is always prefixed with the connection strategy (e.g., auth0, google-oauth2, samlp). This behavior is by design and is not configurable.
To see the full list of the possible prefixes, please go to Create a Connection endpoint of the Management API, unfold Body Parameters, and check the available list of prefixes, under Strategy.
Solution
While a custom user_id can be specified when creating users via the Management API, a first-time login on a Custom Database connection, or by mapping a Security Assertion Markup Language (SAML) connection, these custom IDs will still be prefixed with the connection strategy.
An alternative is to store a secondary identifier in the user's app_metadata.
-
Store a secondary, custom ID in the user's
app_metadata. -
Use an Action to add this custom claim to a token. This makes the ID easily accessible to applications and APIs. For more details, refer to the documentation on how to add custom claims to a token.
NOTE: When providing custom IDs, it is necessary to ensure the IDs are unique across the tenant. It is recommended to add an additional prefix to the custom ID to distinguish between database connections and avoid potential duplicate ID issues. For more information, refer to the documentation on how to identify users.