Localhost and CORS with Auth0 won't let me login

I am making a React app and am trying to use Auth0 for authentication. After trying to login, it returns this:

XMLHttpRequest cannot load https://my-domain.auth0.com/usernamepassword/login . Pre-Flight Request Response Fails Access Control Check: The value of the "Access-Control-Allow-Credentials" header in the response is ", which should be" true "when the request credentials mode" enable ". Origin ' http: // localhost : 3000 'is therefore not allowed The credentials mode of requests initiated by XMLHttpRequest is controlled by the withCredentials attribute.

I thought it would be related to this: CORS issues with Auth0 and React , but I have both Auth0http://localhost:3000, http://localhost:3000/login

in the Allowed Origin (CORS) field (and yes, I am also using the correct client id).

I tried putting http://localhost:3000/, http://localhost:3000/login

in "Allowed Callback URL (not sure exactly what this does), but that didn't work either."

When I use social link (google) it allowed me to login after posting http://localhost:3000/login

in allowed callback urls.

But it still won't work just for new user login.

Any help?

If it matters:

  • Auth0 logs show up for social login, but no logs at all when I connect differently

  • I think it has something to do with the fact that I also get this every time the page is loaded:

    Failed to get SSO data. It could simply mean there is a problem with the network. But, if an "Origin" error was logged before this warning, add " http: // localhost: 3000 " to "Allowed Origin (CORS)" in the Auth0: ... dashboard (link to my dashboard)

  • I am getting 404 from gravatar website

  • Also I am getting these errors (possibly unrelated):

Refused to set unsafe header "accept-encoding"

Refused to set unsafe header "user-agent"

+3


source to share


1 answer


Something is wrong with the client in Auth0. I don't know what it was, but I built an Angular4 app and connected to the same client in Auth0 and got the same errors. Then I tried to delete the client in Auth0 and create a new one and now it works. I have no idea what is causing the error, but creating a new client and connecting to that fixed the problem.



+2


source







All Articles