auth0 / wordpress

WordPress Plugin for Auth0 Authentication
https://auth0.com/docs/cms/wordpress
MIT License
155 stars 96 forks source link

Setup Wizard errors out halfway #218

Closed thameera closed 8 years ago

thameera commented 8 years ago

It seems the Setup Wizard fails half way during authorization.

Steps to reproduce:

  1. Install WordPress plugin.
  2. Click on Auth0 > Setup Wizard > Social > Automatic setup
  3. Login to Auth0 account when prompted

Expected: The browser should redirect back to WordPress successfully.

Actual: An Auth0 error page is shown. Error: There could be a misconfiguration in the system or a service outage. Technical description: invalid_request: Failed to fetch configuration for: (followed by WordPress URL)

glena commented 8 years ago

Cant repro, I just tried with a brand new wordpress install. For some reason, auth0 can't reach the oauth2-client-configuration endpoint on your wordpress.

I will add a way to flush the custom routes and let you know so we can test.

glena commented 8 years ago

can you try to deactivate and activate it again? this should flush the routes again

thameera commented 8 years ago

Done, but same result. Anything else I should try out?

glena commented 8 years ago

to check tomorrow:

thameera commented 8 years ago

Permalink setting is set to 'Plain'. They are viewed using query string params.

glena commented 8 years ago

ok, can you try to set it to any other setting and check if friendly urls works?

thameera commented 8 years ago

Friendly URLs seem to work fine (eg: https://url.com/sample-post/)

xtianjohns commented 8 years ago

I am experiencing this same issue. Does the solution involve changing permalink structures, or is that temporary until a patch can be worked out here?

glena commented 8 years ago

when permalinks are not set up, wordpress does not push the .htaccess to handle custom URLs and because of that, the ones used by the plugin do not work.

I have to find a way to make wordpress write the htaccess in this cases, in the meantime, if you create the .htaccess with this content (the wordpress default), should work fine

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
xtianjohns commented 8 years ago

I see. After logging the requests made to our server during the setup, I see Auth0 asking for /.well-known/oauth2-client-configuration. My server is denying access for that request (responding with a 403).

However, I don't see any rewrite issues taking place there, my permalink structure is Post Name, so I don't think that is causing any problems.

Since my issue isn't related to that, but creates the same general experience as @thameera, I guess I would recommend Auth0 infrastructure log that error code and let me know what's up. Not an issue for this plugin, but just a suggestion. There is an appropriate warning message here:

screen shot 2016-06-28 at 9 51 41 am

It's clear now that Auth0 wasn't able to talk to our infrastructure. However, it's not clear based on the error page from Auth0's web service exactly what failed to connect to what. Thanks for your help @glena.

glena commented 8 years ago

makes sense. sorry for the confusion