404 NotFoundError on Classic Universal Login Page with the Auth0.js SDK Embedded

Problem statement

After setting up a custom domain, a SPA SDK, Auth0.js, embedded in the Universal Login Page started to throw the following error:

{“name”: “NotFoundError”, “statusCode”:404}

Symptoms

404 Not Found is returned against the POST /usernamepassword/login request.

The response body is {“name”: “NotFoundError”, “statusCode”:404}

Steps to reproduce

Initialize the SDK instance without specifying the overrides option.

var webAuth = new auth0.WebAuth({
  clientID: config.clientID,
  domain: config.auth0Domain,
  //code omitted for brevity
  // omit the below "overrides" part to reproduce the issue
  overrides: {
   __tenant: config.auth0Tenant,
   __token_issuer: config.authorizationServer.issuer
  },
  //code omitted for brevity
});

Cause

  • It happens when a SPA makes requests to https://{CUSTM DOMAN}/usernamepassword/login
  • overrides.__tenant option on auth0.WebAuth in the custom login page is not configured.

Solution

Set the overrides.__tenant option on auth0.WebAuth in the custom login page.

Related References