User Already Exists Error When Creating Same Username in Different Database Connections

I’m using username-based login in my Auth0 setup. I have multiple database connections, each representing a different user group.

Here’s the issue:

  • I have a user with the username john_doe in Database A.
  • When I try to create a new user with the same username (john_doe) in Database B, I receive a “user already exists” error.

This is unexpected because I assumed usernames should be unique per connection, not globally across all database connections.

Expected Behavior:

I should be able to create users with the same username in different database connections, as long as they are isolated.

Actual Behavior:

Auth0 throws a user already exists error even though the user is being created in a different connection.

Steps to Reproduce:

  1. Create a user with username john_doe in Connection A.
  2. Attempt to create another user with the same username in Connection B.
  3. Observe the error.

Questions:

  • Is this expected behavior?
  • Is there a workaround or configuration that allows username reuse across different database connections?

Hi @challa_reddy

Welcome to the Auth0 Community!

May I ask how you are creating users in the Auth0?

Thanks
Dawid

Hi @challa_reddy

I just tried, and I’ve been able to create a user in two separate databases with the same username. Can you verify if you are calling separate databases while creating a user?

Thanks
Dawid