Switching to new connection, website complains duplicate user on login

We have a WordPress website which does login through Auth0. We created a LDAP-Auth0 connection myconnection-staging while doing the development. And it was working fine. But then after we deployed the website to prod server, we switched the connection to myconnection-prod and replaced all the client_id, client_secret and audience with the prod ones. There is one user with same username and email existing in both Prod LDAP and staging LDAP. After entering this username on login and clicking Login button, the authentication succeeded but then it redirect me to a page saying “There was a problem with your log in: There is a user with the same email. [error code: unknown]”

But if we try to login with other usernames that are only existing in prod LDAP, it’s working fine.

We have tried every possible solutions. But still no luck.

Can you please help us?


I confess I never went through that exact situation myself, but from your description it seems during the move from development to production you:

  • reset the parts of the system on the Auth0 side; new connection and new client application.
  • did NOT reset the Wordpress part of the system, in particular, the Wordpress database moved from development to production with development data.

The second point above seems problematic because ideally you should reset the whole system and it’s likely that the development data is now causing the issue. It could likely be possible to workaround this particular issue by going into Wordpress management itself and delete the user in question, but you could still be left with remnants of development data.

We have got this problem fixed. The root cause turned out to be that there is one email used by different users in the new LDAP instance as well as the old one. And after we switching our WordPress website to use the new one, we the old users synced from the old LDAP instance are still there. So somehow they conflict (though I don’t understand the behind the scene logic). Then we deleted all users on WordPress that are synced from old LDAP and the problem was gone.

Yes, you are right, we need to reset the system to clear up the users that have been synced from the old LDAP system.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.