# createAuth0Client Failing

**URL:** <https://community.auth0.com/t/createauth0client-failing/164398>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [December 19, 2024, 10:04am UTC](https://community.auth0.com/t/createauth0client-failing/164398 "2024-12-19T10:04:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![benmsullivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/benmsullivan/32/42226_2.png) [@benmsullivan](https://community.auth0.com/u/benmsullivan)\
**Post date:** [December 19, 2024, 10:04am UTC](https://community.auth0.com/t/createauth0client-failing/164398/1 "2024-12-19T10:04:31Z")

</div>

Hi

I am trying to integrate auth0 with my simple JS web app (just webpack, html, typescript, tailwind css - no SPA frameworks) using the JS SDK.

I’m following the quick start guide but I’m getting the following error when calling createAuth0Client:

Failed to load resource: the server responded with a status of 403 ()

I’m also seeing “FailedSilent Auth” in the Auth0 dashboard logs. I need [http://localhost:8080](http://localhost:8080) apparently in the callback URL but the page I’m trying to secure isn’t index.html.

Can I have a callback URL with a path or is only a scheme and authority allowed?

Thanks

Ben

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [December 19, 2024, 3:03pm UTC](https://community.auth0.com/t/createauth0client-failing/164398/2 "2024-12-19T15:03:02Z")

</div>

Hi @benmsullivan,

Allowed Callback URLs: Make sure to specify the protocol (`https://`); otherwise, the callback may fail in some cases. With the exception of custom URI schemes for native clients, all callbacks should use protocol `https://`.

Regarding the error with the quickstart, can you confirm that you are following this quickstart: [Auth0 JavaScript SDK Quickstarts: Login](https://auth0.com/docs/quickstart/spa/vanillajs)? Is your application in the Auth0 tenant set to a Single Page App or Regular Web App? Any screenshots of the errors or code snippets would also be helpful!

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![benmsullivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/benmsullivan/32/42226_2.png) [@benmsullivan](https://community.auth0.com/u/benmsullivan)\
**Post date:** [December 20, 2024, 11:28pm UTC](https://community.auth0.com/t/createauth0client-failing/164398/4 "2024-12-20T23:28:08Z")

</div>

Hi @marybeth.hunter

I’ve reproduced the issue here for you (see commands to run in README):

> **[GitHub - bensullivan/auth0-setup-issue](https://github.com/bensullivan/auth0-setup-issue)**
>
> Contribute to bensullivan/auth0-setup-issue development by creating an account on GitHub.

I don’t use https as I’m developing locally as per the Javascript SDK Quickstarts guide.

Thanks!

---

<div class="post-metadata">

**Author:** ![benmsullivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/benmsullivan/32/42226_2.png) [@benmsullivan](https://community.auth0.com/u/benmsullivan)\
**Post date:** [December 20, 2024, 11:31pm UTC](https://community.auth0.com/t/createauth0client-failing/164398/5 "2024-12-20T23:31:37Z")

</div>

So I think the problem is that the redirect URL for some reason returns a 403 when trying to create the auth0 client in javascript.

![CleanShot 2024-12-21 at 09.48.28@2x](https://global.discourse-cdn.com/auth0/optimized/3X/0/1/014327df13a0a6397e994aeb0d69f1812c41eae9_2_690x26.png)

If I use [http://localhost:8080](http://localhost:8080) for the Allowed Callback URLs in my JS app then I can authenticate.

If I use [http://localhost:8080/index.html](http://localhost:8080/index.html) then creation of auth0 client fails with 403.

Why is that?

I would like to be able to use any valid URL in the Allowed Callback URLs. Is this possible?

Thanks

---

<div class="post-metadata">

**Author:** ![benmsullivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/benmsullivan/32/42226_2.png) [@benmsullivan](https://community.auth0.com/u/benmsullivan)\
**Post date:** [December 21, 2024, 4:01am UTC](https://community.auth0.com/t/createauth0client-failing/164398/6 "2024-12-21T04:01:53Z")

</div>

OK figureed it out - needed to add redirect url to createAuthOClient call:

return await createAuth0Client({  
domain: config.domain,  
clientId: config.clientId,  
authorizationParams: {  
redirect\_uri: `${window.location.origin}/index.html`  
}  
});

---

<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:** [January 4, 2025, 4:02am UTC](https://community.auth0.com/t/createauth0client-failing/164398/7 "2025-01-04T04:02:44Z")

</div>

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