# Why does checkSession require explicitly Allowed Web Origin to be set?

**URL:** <https://community.auth0.com/t/why-does-checksession-require-explicitly-allowed-web-origin-to-be-set/57880>\
**Category:** Get Help\
**Tags:** auth0-spa-js\
**Created:** [February 15, 2021, 3:03pm UTC](https://community.auth0.com/t/why-does-checksession-require-explicitly-allowed-web-origin-to-be-set/57880 "2021-02-15T15:03:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavel.nikolov](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pavel.nikolov/32/12809_2.png) [@pavel.nikolov](https://community.auth0.com/u/pavel.nikolov)\
**Post date:** [February 15, 2021, 3:03pm UTC](https://community.auth0.com/t/why-does-checksession-require-explicitly-allowed-web-origin-to-be-set/57880/1 "2021-02-15T15:03:31Z")

</div>

I’m working with the auth0-spa-js library (version 1.13.6) and I keep getting the error “The specified redirect\_uri ‘[http://lvh.me:8080](http://lvh.me:8080)’ does not have a registered origin.”

After a quick search I realized that I need to set the URL in the Allowed Web Origin URLs, because of the checkSession method.

Is there a particular reason for that? Why is that necessary?

The thing is, on the first login, i.e. when there is no auth0 cookie set, the error does not appear. But after the user has logged in, the error shows up.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 17, 2021, 9:04pm UTC](https://community.auth0.com/t/why-does-checksession-require-explicitly-allowed-web-origin-to-be-set/57880/3 "2021-02-17T21:04:20Z")

</div>

Hi @pavel.nikolov,

`checkSession` requires the “Allowed Web Origin URLs” setting to handle [web message response mode](https://auth0.com/docs/protocols/oauth2?&_ga=2.177404262.239155659.1613392532-1595415333.1607347674#how-response-mode-works). Auth0’s JS SDKs request tokens silently within an iframe to acquire a new Access Token/ID Token for the authenticated user. The Auth0 SDK will process the response and pass the result to a callback function provided by the app. In order for this to occur, the web origin is necessary for the message from the iframe to be posted to the application due to CORS.

Here you can read more about how silent authentication works: [Configure Silent Authentication](https://auth0.com/docs/authorization/configure-silent-authentication#renew-expired-tokens)

Note: `auth0-spa-js` uses the method `getTokenSilently` instead of `checkSession`, but the same web message response mode is used in both methods. Docs: [Migrate from Auth0.js to the Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-single-page-app-sdk/migrate-from-auth0-js-to-the-auth0-single-page-app-sdk#auth0-spa-js)

---

<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:** [March 4, 2021, 9:04pm UTC](https://community.auth0.com/t/why-does-checksession-require-explicitly-allowed-web-origin-to-be-set/57880/4 "2021-03-04T21:04:59Z")

</div>

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