# How to use custom domain in universal login popup?

**URL:** <https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380>\
**Category:** Get Help\
**Tags:** popup, login, custom-domain\
**Created:** [March 23, 2022, 3:03am UTC](https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380 "2022-03-23T03:03:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aryou](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aryou/32/26278_2.png) [@aryou](https://community.auth0.com/u/aryou)\
**Post date:** [March 23, 2022, 3:03am UTC](https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380/1 "2022-03-23T03:03:53Z")

</div>

using auth0 for react

```auto
"@auth0/auth0-react": "1.8.0",
"auth0-js": "^9.17.0",

```

We have a custom domain but how do we get the universal login popup to use the new domain?  
We just have simple button that binds the click in a react app

```auto
const { isAuthenticated, loginWithPopup } = useAuth0();
...
<Button
  onClick={() => loginWithPopup()}
  className="ContinueBTn"
>

```

I’ve tried looking changing some of the configs in the login template but that didn’t work either.  
How can I make the login popup use our custom domain instead of the tenant url @ https://{tenant\_name}.us.auth0.com/?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 23, 2022, 3:52pm UTC](https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380/3 "2022-03-23T15:52:46Z")

</div>

Hi @aryou,

Thanks for reaching out to the Auth0 Community!

I understand that you would like to configure to use your custom domain in the Universal Login Page.

To do so, please see this doc [here](https://auth0.com/docs/customize/custom-domains/configure-features-to-use-custom-domains#universal-login) to learn more about how to configure the Auth0 Universal Login with custom domains.

In this situation, you will need to set the `override` options in your code:

```auto
var webAuth = new auth0.WebAuth({
  clientID: config.clientID,
  domain: config.auth0Domain,
  //code omitted for brevity
  overrides: {
  	__tenant: config.auth0Tenant,
  	__token_issuer: config.authorizationServer.issuer
  },
  //code omitted for brevity
});

```

Once that is complete, you can use your custom domains for login.

Please let me know if there’s anything else I can do to help.

Thank you.

---

<div class="post-metadata">

**Author:** ![aryou](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aryou/32/26278_2.png) [@aryou](https://community.auth0.com/u/aryou)\
**Post date:** [March 28, 2022, 3:04pm UTC](https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380/4 "2022-03-28T15:04:55Z")

</div>

Hi Rueben,  
Thank you for getting back to me. I have uncommented the overrides section in the universal login. This is what it currently looks like but its still not using the custom domain in the popup

```auto
    var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
      auth: {
        redirectUrl: config.callbackURL,
        responseType: (config.internalOptions || {}).response_type ||
          (config.callbackOnLocationHash ? 'token' : 'code'),
        params: config.internalOptions
      },
      configurationBaseUrl: config.clientConfigurationBaseUrl,
      overrides: {
        __tenant: config.auth0Tenant,
        __token_issuer: config.authorizationServer.issuer
      },
      assetsUrl: config.assetsUrl,
      allowedConnections: ['Username-Password-Authentication'],
      rememberLastLogin: !prompt,
      language: language,
      languageBaseUrl: config.languageBaseUrl,
      languageDictionary: languageDictionary,
      prefill: loginHint ? { email: loginHint, username: loginHint } : null,
      closable: false,
      defaultADUsernameFromEmailPrefix: false,
      allowSignUp: false
    });

    // page_background code

    lock.show();

```

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![aryou](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aryou/32/26278_2.png) [@aryou](https://community.auth0.com/u/aryou)\
**Post date:** [March 30, 2022, 9:12pm UTC](https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380/5 "2022-03-30T21:12:54Z")

</div>

Should I be using `new auth0.WebAuth` instead of `new Auth0Lock`?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 1, 2022, 11:12pm UTC](https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380/6 "2022-04-01T23:12:26Z")

</div>

Hi @aryou,

Thank you for your responses.

After further testing, I was able to access my custom domain’s Universal Login page by making a request like the following:

```auto
https://YOUR_CUSTOM_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    scope=SCOPE&
    state=STATE

```

For my configuration, I configured custom domains and used the default Auth0 Lock template with the Classic Universal Login experience.

> [@aryou](#):
>
> Should I be using `new auth0.WebAuth` instead of `new Auth0Lock` ?

Since you are using Auth0 Lock, you can continue using it. And after testing your script, it works for me without any problems. I could access my custom domain login page.

With that, you should be all set and good to go.

Please let me know if you encounter any further issues or have any questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 21, 2022, 5:14pm UTC](https://community.auth0.com/t/how-to-use-custom-domain-in-universal-login-popup/80380/7 "2022-12-21T17:14:15Z")

</div>


