Silent authentication fails on capacitor app with error "the specified redirect_uri does not have a registered origin"

  • Which SDK this is regarding: auth0-angular
  • SDK Version: 1.8.0
  • Platform Version: Node 14.18.1

I’m following the guide here and running into an error when the application tries to do silent authentication.

My redirect_uri is in the format:

${config.appId}://YOUR_DOMAIN/capacitor/${config.appId}/callback

And I’ve set the allowed origins to

capacitor://localhost, http://localhost

Here is the logs for one of the failed requests with sensitive data redacted.

{
  "date": "2021-12-08T04:17:26.556Z",
  "type": "fsa",
  "description": "The specified redirect_uri ***REDACTED*** does not have a registered origin.",
  "ip": "***REDACTED*** ",
  "user_agent": "Chrome 96.0.4664 / Windows 10.0.0",
  "details": {
    "body": {},
    "qs": {
      "redirect_uri": "***REDACTED*** ",
      "client_id": "***REDACTED*** ",
      "errorPath": "/callback",
      "scope": "openid profile email offline_access",
      "response_type": "code",
      "response_mode": "web_message",
      "state": "***REDACTED*** ",
      "nonce": "***REDACTED*** ",
      "code_challenge": "***REDACTED*** ",
      "code_challenge_method": "S256",
      "prompt": "none",
      "auth0Client": "***REDACTED*** "
    },
    "connection": null,
    "error": {
      "message": "The specified redirect_uri ***REDACTED***  does not have a registered origin.",
      "oauthError": "invalid_request",
      "type": "request-error"
    }
  },
  "hostname": "***REDACTED*** ",
  "auth0_client": {
    "name": "@auth0/auth0-angular",
    "version": "1.8.0"
  },
  "log_id": "90020211208041730958079736593914760752662345371405516898",
  "_id": "90020211208041730958079736593914760752662345371405516898",
  "isMobile": false
}

Any help that can be provided would be greatly appreciated, currently blocked on this. Thank you

2 Likes

2022, facing the same issue. Did you manage to get rid of it by any way ?