Hello,
I am configuring Auth0 with WordPress. I have the database connection setup and everything configured. I have the create new user disabled on WordPress as we use our custom signup form for our members.
The issue is that when i login from my WordPress account, the user gets created in Auth0 with all the proper id and email, but WordPress is trying to create a new user instead of just using the existing user. I want to continue using WordPress as the starting point for my members to signup.
here are my settings:
WordPress:
Hello!
The issue where WordPress tries to create a new user upon login despite existing in Auth0 (created via your custom signup) likely stems from the Auth0 WordPress plugin not correctly mapping the WordPress login attempt to the pre-existing Auth0 user. The solution lies in carefully reviewing and configuring the user linking/mapping settings within the Auth0 WordPress plugin. Ensure it’s set to identify users based on a consistent identifier (likely the email address) used in both your custom signup and WordPress login, potentially triggering a user linking process if needed. Review the plugin’s documentation for precise configuration options.
As @Brian297Perkins has mentioned regarding the duplicated users in Wordpress, most probably the cause would be a misconfiguration regarding the user mapping. Instead of Wordpress mapping the login to an existing user, it appears to be ignoring that completely and attempting to create a new one.
For more information regarding integrating Auth0 with Wordpress, you can review our documentation on the matter.
If you have any other questions, feel free to leave a reply!
Thanks Brian, the issue was with Auth0 plugin as it installed the older v4 version.
I followed the instructions to install the latest Auth0 v5 plugin, now i have a different issue.
As soon as i active Auth0 plugin, I am unable to update the pages in wordpress.
When i go to a page which requires login, i get the Auth0 login page and i am able to login successfully, the user is created in Auth0, everything is perfect there but i am taken to the homepage after login, even if i try to click my page link it stops redirection and i am still logged in.
anyone facing this issue?
should i just give up on Auth0 wordpress plugin and go the SDK route?
thanks,
Mehdi
I have more update on this, so i am back to the point where Auth0 is trying to create a new user in WordPress even with version 5. I have set email as the identifier in the Auth0 plugin and still it creates a new user in wordpress. The email address of the user is same in both Auth0 and WordPress. I also noticed that i dont see the auth0_status cookie as mentioned in the troubleshooting steps.
Hey @nik.baleca - I am now on the new v5 plugin. I have tried disabling caching, adding the cookies and url to be excluded from cache but i havent been able to make it work. It did work only once and i see in the db that user is mapped. After the initial user i keep seeing “invalid state” errors. I am on cloudways hosting if that help. I do see in the docs that i should see auth_state cookie, but i havent seen it even when once it worked.
could you please provide some other workaround as i am stuck here.
I am currently still investigating the issue on my end.
Could you check if the user you are trying to log into has been previously created on WordPress via another login plugin? That can cause an issue and an invalid state error.
Otherwise, can you also attempt a fresh install of the v5 plugin to make sure there are no other conflicts with the previous version to see if anything else changes?
In the meantime, I would advise to also submit an Issue on Github.
If you have any other updated, please leave a reply!
hey @nik.baleca,
I have a fresh version of WordPress installed and the latest v5 plugin from github. I also have all plugins disabled and caching disabled on the server level.
My scenario is that we want to continue using WordPress users as we have a signup flow. Auth0 is being used for authentication and we dont want Auth0 creating any users in WordPress.
The user in this fresh WordPress install is manually created by me as i am trying to test the plugin on a demo server before i install it on our prod server.
I still see “invalid state” error in error logs.
I will submit this on github too.
Hey @nik.baleca I got it working, the problem is with the database custom code. No where in the documentation its mentioned that the custom script needs to return email verified as true as well. Thats the reason Auth0 plugin was trying to create a new user in wordpress everytime as the email was not verified. I believe we should add a custom setting in Auth0 plugin where we can have a boolean value to disable this check.