# Auth0-spa-ja: validation of "Allowed web origins" does not support wildcards for silent authentication

**URL:** <https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879>\
**Category:** Get Help\
**Tags:** auth0-spa-js\
**Created:** [September 14, 2019, 2:06am UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879 "2019-09-14T02:06:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shorn](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shorn/32/14907_2.png) [@Shorn](https://community.auth0.com/u/Shorn)\
**Post date:** [September 14, 2019, 2:06am UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879/1 "2019-09-14T02:06:46Z")

</div>

I am upgrading from auth0.js to auth0-spa-js v1.2.3.

My app was working fine on localhost, but then after deployment; the first authentication would succeed, but any subsequent refresh or opening of a new tab it would exhibit the “pause for 1 minute, then fail to login” behavior similar to this thread:  
[http://community.auth0.com/t/authentication-breaks-when-client-refreshes-browser](http://community.auth0.com/t/authentication-breaks-when-client-refreshes-browser)

I was able to workaround the problem by clearing the “auth0.is.authenticated” cookie.  
I’m assuming this is related to “silent authentication”, because of this: [Question: what is the use of 'auth0.is.authenticated' cookie · Issue #95 · auth0/auth0-spa-js · GitHub](https://github.com/auth0/auth0-spa-js/issues/95)

One thing I noted was the the Auth0 side logs showed “Failed Silent Auth: The specified redirect\_uri ‘[https://app.example.com](https://app.example.com)’ does not have a registered origin”.  
Yet I had “https://\*.example.com” in the “Allowed web origins” field, not to mention the first login (with no cookie present) works fine.

So I added “[https://app.example.com](https://app.example.com)” to the “Allowed web origins” field and the app started working properly.

I think Auth0 needs to unify the validation logic between initial login and silent auth. This problem was made much harder to diagnose because the initial login worked and only silent-auth fails. Either wildcards should be allowed for both calls, or neither.

Personally, I’d prefer you allowed wildcards. If the reasoning for not allowing wildcards is “because security”, then doesn’t that imply the initial login logic has a security hole in it, since it allows the login via a wildcard?

If you decide that wildcard origins are not supported, please add that to the FAQ - since it seems to work fine with the auth0.js library that my app currently uses (including silent authentication). Some folks will need to know about this when porting - it might save them a lot of wasted effort if they need wildcards.

You probably should think about better error handling and feedback with auth0-spa-js client too. The observed behavior (pause for one minute when creating the auth0 client object, then silent return) is not terribly helpful, though I can see how it might be hard to provide good feedback without security repercussions.

---

<div class="post-metadata">

**Author:** ![Shorn](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shorn/32/14907_2.png) [@Shorn](https://community.auth0.com/u/Shorn)\
**Post date:** [September 16, 2019, 2:44am UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879/2 "2019-09-16T02:44:52Z")

</div>

In re-reading this post - it sounds kind of negative.  
So I thought I should add I think you’ve done a great job with the new library - it makes my app more light-weight and I get to remove a bunch of code that is now being taken card of by Auth0.

---

<div class="post-metadata">

**Author:** ![danprime](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/danprime/32/20214_2.png) [@danprime](https://community.auth0.com/u/danprime)\
**Post date:** [April 1, 2020, 4:33am UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879/3 "2020-04-01T04:33:09Z")

</div>

This needs to be upvoted. I had the problem of Failed Silent Auth in the logs but the browser console showed a 400 error of unregistered web origin uri. Even though the callbacks and origin urls were correctly registered.

The only thing that pointed to this was the fact that auth0.is.authenticated cookie was set (even though I wasn’t logged in).

---

<div class="post-metadata">

**Author:** ![gwidon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwidon/32/19995_2.png) [@gwidon](https://community.auth0.com/u/gwidon)\
**Post date:** [May 13, 2020, 11:43am UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879/4 "2020-05-13T11:43:04Z")

</div>

@jmangelo @konrad.sopala Guys, could you please take a look on this. This post is quite old now and I’m keep watching it and waiting for response as I had same issue. Could you please advice how to handle silent auth with wildcards subdomains with auth0-spa-js

---

<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:** [May 13, 2020, 12:32pm UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879/5 "2020-05-13T12:32:16Z")

</div>

Hey there!

I think you may also want to read this:

> [@How come "Allowed Web Origins" does not allow wildcards?](http://community.auth0.com/t/how-come-allowed-web-origins-does-not-allow-wildcards/9185):
>
> The other client fields “Allowed Callback URLs”, “Allowed Logout URLs”, and “Allowed Origins (CORS)” all support wildcards… I want/need wildcard support because I am in the process of moving my Google App Engine application to Auth0’s Hosted Login Page solution and taking advantage of checkSession() in auth0.js to reduce the amout of times the login page is displayed. Everything works great so far. Google App Engine lets me run multiple versions of my application, with the “default” version b…

---

<div class="post-metadata">

**Author:** ![bandrews](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bandrews/32/21746_2.png) [@bandrews](https://community.auth0.com/u/bandrews)\
**Post date:** [June 4, 2020, 9:30pm UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879/6 "2020-06-04T21:30:56Z")

</div>

+1 to the suggestion to figure out a way to improve the developer experience here… even if it’s just a document listing all the scenarios you need to test to ensure that you’re properly configured.

I’ve replied to the wildcard thread, but I also made it almost all the way to production without realizing this was a fundamental limitation, and now we’re pretty much screwed trying to figure out if we need to replace our entire auth infrastructure because of the no-wildcard limitation ☹

---

<div class="post-metadata">

**Author:** ![4degrees](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/4degrees/32/23681_2.png) [@4degrees](https://community.auth0.com/u/4degrees)\
**Post date:** [August 19, 2020, 6:46pm UTC](https://community.auth0.com/t/auth0-spa-ja-validation-of-allowed-web-origins-does-not-support-wildcards-for-silent-authentication/30879/7 "2020-08-19T18:46:14Z")

</div>

Just hit this same issue and wasted a bunch of time on figuring it out ☹
