# Wildcard domains does not seem to work. Is specifying the port messing it up?

**URL:** <https://community.auth0.com/t/wildcard-domains-does-not-seem-to-work-is-specifying-the-port-messing-it-up/199146>\
**Category:** Get Help\
**Tags:** custom-domains-flows, branding\
**Created:** [April 20, 2026, 11:34am UTC](https://community.auth0.com/t/wildcard-domains-does-not-seem-to-work-is-specifying-the-port-messing-it-up/199146 "2026-04-20T11:34:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carl.erik.kopseng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/carl.erik.kopseng/32/72928_2.png) [@carl.erik.kopseng](https://community.auth0.com/u/carl.erik.kopseng)\
**Post date:** [April 20, 2026, 11:34am UTC](https://community.auth0.com/t/wildcard-domains-does-not-seem-to-work-is-specifying-the-port-messing-it-up/199146/1 "2026-04-20T11:34:25Z")

</div>

I’m trying to avoid maintaining per-brand callback URLs in Auth0 for a whitelabel app.

We use domains like `{brand}.example.com`, `{brand}.stage.example.com`, and locally `{brand}.localhost:3000`.

Auth0’s docs say wildcard subdomains are allowed in Allowed Callback URLs, for example `https://*.example.com`, as long as the wildcard is in the leftmost subdomain. Based on that, `http://*.localhost:3000/auth/callback` appears like it should allow `http://mybrand.localhost:3000/auth/callback`.

But in practice Auth0 is rejecting that callback, even though the docs seem to allow it.

Is `.localhost` or `.localhost:3000` treated differently from normal domains for wildcard callback matching, or is there another limitation here that isn’t obvious from the docs?

---

<div class="post-metadata">

**Author:** ![carl.erik.kopseng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/carl.erik.kopseng/32/72928_2.png) [@carl.erik.kopseng](https://community.auth0.com/u/carl.erik.kopseng)\
**Post date:** [April 20, 2026, 1:27pm UTC](https://community.auth0.com/t/wildcard-domains-does-not-seem-to-work-is-specifying-the-port-messing-it-up/199146/2 "2026-04-20T13:27:03Z")

</div>

I might add, the wildcard works _fine_ for non-loopback domains. Doing `https://*.stage.example.com/auth/callback` works fine for different subdomains.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [April 20, 2026, 9:51pm UTC](https://community.auth0.com/t/wildcard-domains-does-not-seem-to-work-is-specifying-the-port-messing-it-up/199146/4 "2026-04-20T21:51:38Z")

</div>

Hi @carl.erik.kopseng

Welcome to the Auth0 Community!

The behaviour that you are seeing is expected, as `localhost` is treated as a top-level domain and the callback fails since the [wildcard **must** be located in a subdomain](https://auth0.com/docs/get-started/applications/wildcards-for-subdomains#:~:text=The%20wildcard%20must%20be%20located%20in%20a%20subdomain%20within%20the%20hostname%20component.%20https%3A//*.com%20will%20not%20work) within the hostname component. This is also mentioned on the following topic : [Wildcards for subdomain callbacks not working](https://community.auth0.com/t/wildcards-for-subdomain-callbacks-not-working/45187) and what you are seeing on your end falls under the expected outcome.

In addition, [ports in the callback URLs](https://community.auth0.com/t/domain-configuration/96593) that use wildcards are not allowed, as these would need to be explicitly specified. While adding a list of callback URLs ( due to their ports ) can be inconvenient, this method is the most secure way of achieving your goal.

We warmly recommend submitting a [Feature Request](https://auth0.com/feedback) on this matter where other users can vote on it. As the page is monitored by our Product team, more popular suggestions can create interest and further drive the development.

Hope this helped!  
Gerald

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 4, 2026, 9:52pm UTC](https://community.auth0.com/t/wildcard-domains-does-not-seem-to-work-is-specifying-the-port-messing-it-up/199146/5 "2026-05-04T21:52:29Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
