Cannot read property 'tenant_id' of undefined

I’ve been setting up Single Sign On with Active Directory for our application according to this instruction:

https://auth0.com/docs/authenticate/identity-providers/enterprise-identity-providers/azure-active-directory/v2#register-your-app-with-azure-ad

However, after redirect to the Microsoft page i get this error:

Cannot read property ‘tenant_id’ of undefined

In my Auth0 Dashboard under

Monitoring > Logs

i found this error log:

{
  "date": "2022-02-28T09:05:51.484Z",
  "type": "f",
  "description": "Cannot read property 'tenant_id' of undefined",
  "connection_id": "",
  "client_id": "XXXXXXX",
  "client_name": "XXXXXXX (DEV)",
  "ip": "195.192.198.XXX",
  "user_agent": "Chrome 98.0.4758 / Mac OS X 10.15.7",
  "details": {
    "body": {},
    "qs": {
      "client_id": "XXXXXXXX",
      "redirect_uri": "http://localhost:3000",
      "scope": "openid profile email",
      "response_type": "code",
      "response_mode": "query",
      "state": "WmdOOEpBTUlKTG5mQks1LjJLY3JabEwyUVBJTDZNeTdVZE1TZjNGVDhFUw==",
      "nonce": "OG94dlNjbEFyUDJXcnNmeWNEamhSa1IxWHVSV08wcUxZS0tVQ3NwTjRjWA==",
      "code_challenge": "8tWkNmx5qUlDVpIUCJy68B1lWwPa6qi1ZpMjq-4WZAc",
      "code_challenge_method": "S256",
      "auth0Client": "XXXXXXXXXX"
    },
    "error": {
      "message": "Cannot read property 'tenant_id' of undefined",
      "oauthError": "access_denied",
      "type": "oauth-authorization"
    },
    "session_id": "7aXIltPAKa0e0vQhqyyAblzIWjmvbiy",
    "riskAssessment": {
      "confidence": "high",
      "version": "1",
      "assessments": {
        "UntrustedIP": {
          "confidence": "high",
          "code": "not_found_on_deny_list"
        },
        "NewDevice": {
          "confidence": "high",
          "code": "initial_login"
        },
        "ImpossibleTravel": {
          "confidence": "high",
          "code": "initial_login"
        }
      }
    }
  },
  "hostname": "XXXXXXX.eu.auth0.com",
  "user_id": "XXXXXXXX",
  "user_name": "XXXX@XXXX.com",
  "audience": "https://XXXXXXX.eu.auth0.com/userinfo",
  "scope": [
    "openid",
    "profile",
    "email"
  ],
  "auth0_client": {
    "name": "auth0-react",
    "version": "1.9.0"
  },
  "log_id": "900202202280905566349491050266127672706556666XXXXXXX",
  "_id": "900202202280905566349491050266127672706556666XXXXXXX",
  "isMobile": false
}

What i’ve been trying so far:

  • Created a new Auth0 account and connect the sample React Login application (https://github.com/auth0-samples/auth0-react-samples/tree/master/Sample-01) provided by Auth0 to the same Active Directory endpoint (works :white_check_mark:)

  • Connect our Development Auth0 account to Active Directory using the Auth0 React sample app (doesn’t work :x:)

  • Connect our React development application to the Active Directory Endpoint (throws error as shown above :x:)

  • Playing around with different Callback URLs. Added some URLs and Routes to the existing http://localhost:3000 (doesn’t work :x:)

I think this error was caused by wrong settings in our Auth0 account since creating a new account doesn’t show any problems. I also don’t see any issues caused by setting up the Active Directory application.