Custom domain with default login page has end point error

I am currently using the default auth0 login and attempting to use it on my custom domain.

The tenant name and domain name are different.

Everything works fine using the auth0 login domain below:

new auth0.WebAuth({
      domain: '<tenant>.auth0.com',
      clientID: 'azh9EQ7ccON0T6lcbI5Qk2cMfeoDrIn1',
      redirectUri: 'http://localhost:4000',
      audience: 'https://api-dev.<domain>.com',
      responseType: 'token id_token',
      scope: 'openid profile email',
    })

Below is my custom domain settings:

new auth0.WebAuth({
      domain: 'login.<domain>.com',
      clientID: 'azh9EQ7ccON0T6lcbI5Qk2cMfeoDrIn1',
      redirectUri: 'http://localhost:4000',
      audience: 'https://api-dev.<domain>.com',
      responseType: 'token id_token',
      scope: 'openid profile email',
    })

I get the following error:

"You should not be hitting this endpoint. Make sure to use the code snippets shown in the tutorial or contact support@auth0.com for help"

Any help would be appreciated. Thank you!

1 Like

I’m getting the same error. Any luck with fixing it?

Yes, you need to pass in override options:

new auth0.WebAuth({
      domain: 'login.<domain>.com',
      clientID: 'azh9EQ7ccON0T6lcbI5Qk2cMfeoDrIn1',
      redirectUri: 'http://localhost:4000',
      audience: 'https://api-dev.<domain>.com',
      responseType: 'token id_token',
      scope: 'openid profile email',
      overrides: {
        __tenant: '<tenant-name>',
        __token_issuer: 'login.<domain>.com'
      },
    })
2 Likes

This is documented here: Configure Features to Use Custom Domains

2 Likes