Verifying if a user is logged in on another domain

Hello. Our app is splitted on a main domain and a subdomain and we need a user logged in across them. We want to share a login session between different domains - to login on the main domain, to keep information about the user login, then to be redirected to the subdomain where this information about the user login will be retrieved. But, every time we switch to the subdomain, we need to click the login button first (which login right away). What we want, this user is logged in right away and not having to click the login button every time.

Is this possible? If so, how? We are using Auth0 Single Page App SDK.

Hi @dmitriy.movch,

that works out of the box with our SDKs and setup.

Firstly, here is a blog post that explains how and why SSO works the way it does:

Regarding your implementation: the keyword is “silent authentication” and our Quickstarts usually cover this (choose the one that matches your technology stack).

You should also find examples when searching for auth0-spa-js and gettokensilently in this forum.

Auth0 SPA SDK API reference:

Mathias, thank you for the reply. I am using the React example from your Quickstarts but silent authentication does not happen. As I understand, I will need to use getTokenSilently() method in order to implement silent authentication. I will try it and let you know if it is ok.