Auth0 redirect not working in chrome while using nodejs as backend and react js on front-end

If you click the “View Log” button, does it provide additional context?

Yes the following logs come up

This error suggests there is a problem with the redirect uri you are submitting.

Can you confirm that the redirect uri is correct and matches the allowed callback settings in your application?

Can you also please confirm the version of the auth0-react SDK you are using?

We have the same issue since the this week, luckly us it is our staging environment.

We have the URL defined in 4 boxes in the application settings the @auth0/auth0-react is doing an infinite redirection loop between our apps and auth0

Yes I’ve checked the uri again.

Also the version you asked for is
@auth0/auth0-react”: “^1.12.1”

@nishit,

That version of the SDK uses a different syntax for the redirect URI. Upgrade to the latest version and that should solve the error.

It’s mentioned in the migration guide: auth0-react/MIGRATION_GUIDE.md at master · auth0/auth0-react · GitHub

Auth0 (and other deps) are updated now. App is not working still

"@auth0/auth0-react": "^2.0.1"

@nishit Do you have any more info?

yeah actually we implemented the whole flow with the best practices as you mentioned earlier but now there is a different type of error , while reviewing the logs these were the event that we encountered:-

  1. Success Login
{
  "date": "2023-04-22T10:11:07.948Z",
  "type": "s",
  "connection": "Username-Password-Authentication",
  "connection_id": "example",
  "client_id": "example",
  "client_name": "example",
  "ip": "example",
  "user_agent": "Chrome 107.0.0 / Windows 10.0.0",
  "details": {
    "prompts": [
      {
        "name": "prompt-authenticate",
        "completedAt": 1682158267426,
        "connection": "Username-Password-Authentication",
        "connection_id": "example",
        "strategy": "auth0",
        "identity": "example",
        "stats": {
          "loginsCount": 1245
        },
        "elapsedTime": null
      },
      {
        "name": "login",
        "flow": "universal-login",
        "initiatedAt": 1682158247658,
        "completedAt": 1682158267456,
        "user_id": "example",
        "user_name": "example@test.com",
        "timers": {
          "rules": 3
        },
        "elapsedTime": 19798
      }
    ],
    "initiatedAt": 1682158247643,
    "completedAt": 1682158267947,
    "elapsedTime": 20304,
    "session_id": "example",
    "stats": {
      "loginsCount": 1245
    }
  },
  "hostname": "example",
  "user_id": "example",
  "user_name": "example@test.com",
  "strategy": "auth0",
  "strategy_type": "database",
  "organization_id": "example",
  "organization_name": "techlight",
  "log_id": "example",
  "_id": "example",
  "isMobile": false,
  "id": "example",
  "description": "Successful login"
}
  1. Success Exchange
{
  "date": "2023-04-22T10:11:10.463Z",
  "type": "seacft",
  "description": "Authorization Code for Access Token",
  "connection_id": "",
  "client_id": "example",
  "client_name": "example",
  "ip": "example",
  "user_agent": "Chrome 107.0.0 / Windows 10.0.0",
  "details": {
    "code": "******************************************ECA"
  },
  "hostname": "example",
  "user_id": "example",
  "user_name": "example@test.com",
  "organization_id": "example",
  "organization_name": "techlight",
  "auth0_client": {
    "name": "auth0-react",
    "version": "2.0.1"
  },
  "log_id": "example",
  "_id": "example",
  "isMobile": false,
  "id": "example"
}
  1. Failed silent Auth
{
  "date": "2023-04-22T10:11:10.681Z",
  "type": "fsa",
  "description": "Login required",
  "client_id": "example",
  "client_name": "example",
  "ip": "example",
  "user_agent": "Chrome 107.0.0 / Windows 10.0.0",
  "details": {
    "body": {},
    "qs": {
      "client_id": "example",
      "scope": "openid read:current_user update:current_user_metadata",
      "redirect_uri": "example",
      "audience": "example",
      "prompt": "none",
      "response_type": "code",
      "response_mode": "web_message",
      "state": "example",
      "nonce": "example",
      "code_challenge": "example",
      "code_challenge_method": "S256",
      "auth0Client": "example"
    },
    "connection": null,
    "error": {
      "message": "Login required",
      "oauthError": "login_required",
      "type": "oauth-authorization"
    },
    "session_id": "example,
    "riskAssessment": null,
    "session_connection": "Username-Password-Authentication"
  },
  "hostname": "example",
  "audience": "example",
  "scope": [
    "openid",
    "read:current_user",
    "update:current_user_metadata"
  ],
  "auth0_client": {
    "name": "auth0-react",
    "version": "2.0.1"
  },
  "log_id": "example",
  "_id": "example",
  "isMobile": false,
  "id": "example"
}

also we have reviewed our code throughly

Thank you

@nishit,

Thanks for providing some more detailed information. :smile:

A silent login often fails when the cookie session isn’t able to be used to renew the tokens. Does the silent login fail on all browsers? Determining this can help to narrow down the problem to a specific browser vs. a problem with the setup/config.

yes the login is not working on any browser

What have you tried to resolve the issue?

yes we tried to resolve the issue but the issue still persisted with the information that we provided in earlier reply .

@nishit,

Apologies for not being clear. I asked what have you tried to resolve the new error you are seeing? Besides providing the info that it is not working, what have you done to try to resolve the error on your side?

It’s difficult for me to walk through every step of debugging your application because I don’t have access to it. Without you first attempting to solve the error on your own, this process becomes cumbersome. For example, you may start by googling the error code you are seeing and then work through the strategies provided by the top results.

Here are some results I find:

1 Like

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