React demo app not working

I followed this doc to test login to react app.

When i login with test user, i get “Oops… unauthorized”

redirect_uri under authorizationParams is set to window.location.origin. May be this is causing the issue. What should be the value for this param?

Steps to reproduce:

  1. create an auth0 account
  2. download the React quickstart guide
  3. fill the ‘domain’ field and ‘clientId’ field with client ID of the Default App in index.js
  4. add ‘http://localhost:3000’ to Allowed Callback URLs, Allowed Web Origins, and Allowed Logout URLs
  5. run npm install and npm start in the root directory of the quickstart
  6. click the login button
  7. attempt to login using test user
  8. receive error: “Oops… unauthorized”
1 Like

Hello @perathkarthik ,

Welcome to the Community!

Would you be able to either:

  1. Create a new application, ensure it is a Single Page Application type and that the Token Endpoint Authentication Mode setting is “None”

  2. Modify your existing Default App so that Token Endpoint Authentication Mode is set to “None”. For SPAs, this option is normally disabled, so you may need to change to a different application type, change this setting and then set it back to SPA again.

You can refer here about the fix discussed on GitHub.

This issue is also very similar to the one posted in the Community and sharing for your reference as well.

The redirect_uri should not be the cause of error in this case.

Thanks!

2 Likes

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