How to Prevent Duplicate Auth0 Users When Using Multiple Social Connections

Overview

This article covers configuring multiple social connections for a single Identity Provider and maintaining distinct Auth0 user identities for each.

Applies To
  • Custom Social Connections
Cause

Auth0 allows a single instance of each standard social connection type in the Auth0 Dashboard, though multiple can be created via the Management API. However, depending on the social IdP, the provider might return the same user ID for different OAuth applications.

 

Because Auth0 generates a user ID based on the connection type and the provider's user ID (for example, <connection_type>|<user_id>), multiple standard connections for the same IdP can result in duplicated user IDs in Auth0. This duplication causes unexpected behavior, such as account linking failures.

Solution

To resolve the issue, create Custom Social Connections. The user ID for a custom social connection is formatted as oauth2|<connection_name>|<user_id>. By creating multiple custom connections with unique names for the same IdP, Auth0 generates distinct users for each connection, preventing duplicate user ID conflicts.

 

Related References

Recommended content

No recommended content found...