# Svelte authentication over network

**URL:** <https://community.auth0.com/t/svelte-authentication-over-network/59651>\
**Category:** Get Help\
**Created:** [March 18, 2021, 3:44pm UTC](https://community.auth0.com/t/svelte-authentication-over-network/59651 "2021-03-18T15:44:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnorris-10](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/johnnorris-10/32/12921_2.png) [@johnnorris-10](https://community.auth0.com/u/johnnorris-10)\
**Post date:** [March 18, 2021, 3:44pm UTC](https://community.auth0.com/t/svelte-authentication-over-network/59651/1 "2021-03-18T15:44:24Z")

</div>

I have gone through “Authenticating Svelte Applications” in blogs. I set up an auth0 account and it works.  
My setup is a linux VM running on a windows host. I have changed package.json so that it is available from the host browser as well as localhost.  
If I set callback\_url’s etc to localhost:5000 then it works with localhost but from the PC, I get  
Uncaught (in promise) Error:  
auth0-spa-js must run on a secure origin.  
when I try to login.  
If I set callback\_urls etc to VM\_name:5000 then locally I get  
Callback URL mismatch.  
The provided redirect\_uri is not in the list of allowed callback URLs.

What am I doing wrong? (I would have raised this on the blog discssion but that was closed after 28 days)  
Regards,John

---

<div class="post-metadata">

**Author:** ![Ale](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ale/32/50860_2.png) [@Ale](https://community.auth0.com/u/Ale)\
**Post date:** [March 18, 2021, 4:05pm UTC](https://community.auth0.com/t/svelte-authentication-over-network/59651/3 "2021-03-18T16:05:07Z")

</div>

Welcome to the Auth0 Community, @johnnorris-10!

This behaviour seems related to [auth0-spa-js/FAQ.md at master · auth0/auth0-spa-js · GitHub](https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin)

The problem is Web Cryptography API requires a secure origin. As you can see, for some browsers (not all of them, but Chrome is probably the most notorious), you are not following at least one of the patterns mentioned in the documentation above. This means that for Chrome, you are not running your application from a secure origin. There’s a good conversation on this here: [https://github.com/w3c/webcrypto/issues/28](https://github.com/w3c/webcrypto/issues/28) and also here: [25972 – Please require a secure origin](https://www.w3.org/Bugs/Public/show_bug.cgi?id=25972)

---

<div class="post-metadata">

**Author:** ![johnnorris-10](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/johnnorris-10/32/12921_2.png) [@johnnorris-10](https://community.auth0.com/u/johnnorris-10)\
**Post date:** [March 19, 2021, 6:57am UTC](https://community.auth0.com/t/svelte-authentication-over-network/59651/5 "2021-03-19T06:57:18Z")

</div>

I am using Firefox. But as you say this will affect all browsers.  
I have got this to work with keycloak but that was hosted locally rather than third party like auth0.  
So localhost only then.  
Many thanks.

---

<div class="post-metadata">

**Author:** ![Ale](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ale/32/50860_2.png) [@Ale](https://community.auth0.com/u/Ale)\
**Post date:** [March 20, 2021, 1:51am UTC](https://community.auth0.com/t/svelte-authentication-over-network/59651/6 "2021-03-20T01:51:11Z")

</div>

I’m happy to help! Good luck with your implementation.

---

<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:** [March 26, 2021, 10:03am UTC](https://community.auth0.com/t/svelte-authentication-over-network/59651/7 "2021-03-26T10:03:53Z")

</div>


