Wordpress Login with auth0 plugin

@vasims - It would be tough to figure anything out in your site configuration if I’m not clear on what you’re trying to accomplish here. The configuration is pretty straight-forward as long as we know what you’re trying to do. Let me outline what I think I understand here and you tell me if I’m wrong.

You have 3 separate WordPress sites that do not use WordPress multisite:

  1. example.com
  2. example.com/am
  3. example.com/fs

You want to be able to log into one site and have that authenticate you on all three sites. In other words, one account and password will get you into all 3 sites (SSO). You mentioned roles as well but I’m not clear exactly what you want to do there.

If this is correct, then you’ll need the following:

  1. One database connection in Auth0 (you can use the default one called “Username-Password-Authentication”
  2. One Application for each site (following the configuration steps here), all three activated on the database connection mentioned above
  3. Configure each WordPress site with the corresponding domain, client ID, and client secret from step 2, as well as the SSO setting turned on under the Features tab in the plugin settings.

You don’t want to use the Setup Wizard in the plugin to set all this up, as it will create a separate database for each site. You also can’t use the User Migration option since there are 3 sites and only a single Auth0 database.

With all of this setup, a login at Auth0 will apply to all site but keep in mind that each of the WordPress sites also need an active session. This means that you can’t login to one site then navigate to different site and be authenticated. You’ll need to visit wp-login.php and the SSO will happen there. So, for pages that need authentication, you’ll need to check that first before loading. This can be done in a page template (example) or more generally in the template_redirect hook (example, for a WooCommerce task but can be adapted).

Let me know if that helps or if you need additional guidance here. Thank you and happy new year!