When calling checkSession i get error "Failed to load resource: the server responded with a status of 400 ()"


I have a few apps that are using the same login flow and i want users to have a seamless experience regarding authentication. When he logs into an app and navigates to another i want to also be logged in there. Therefore, i call checkSession at app load, and make a polling every each 15 minutes to check the session ( as stated here Auth0.js v9 Reference )

On localhost, everything works fine. However, when i try to test in on a staging environment the checkSession call gives an error in the console Failed to load resource: the server responded with a status of 400 () then after about 1 minute it throws an error {original: {…}, code: "timeout", description: "Timeout during executing web_message communication", error: "timeout", error_description: "Timeout during executing web_message communication"}
When opening the call url to a new tab i get this message: Oops!, something went wrong There could be a misconfiguration in the system or a service outage. We track these errors automatically, but if the problem persists feel free to contact us. Please try again.

If instead of checkSession i try calling the authorize method and then parseHash (from auth0.WebAuth) that flow works fine.

I configured in auth0 dashboard the Allowed Callbacks URLs and Allowed Web Origins and Allowed Logout URLs and Allowed Origins (CORS) for both localhost and staging environments


Solved it. Apparently, for checkSession to work, urls in Allowed Web Origins MUST NOT end with /.

So, https://xxxxx.mydomain.com is correct, but https://xxxxx.mydomain.com/ is NOT


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