Session status iframe reports user is logged out

Hi,

I’m using Keycloak and the Keycloak JavaScript adapter for a single page web application. I create and initiate the adapter following the documentation:

adapter = new Keycloak({
  url: ENV.APP.KEYCLOAK_URL,
  realm: ENV.APP.KEYCLOAK_REALM,
  clientId: ENV.APP.KEYCLOAK_CLIENT_ID,
});
adapter
.init({
  onLoad: "check-sso",
  silentCheckSsoRedirectUri: ENV.APP.KEYCLOAK_SSO_REDIRECT_URI,
  enableLogging: ENV.APP.KEYCLOAK_LOGGING,
})

Authentication is working. adapter.login() redirects to Keycloak that will redirect back to my single page web application. On the redirect back, Keycloak JavaScript adapter via the check-sso iframe will recognise that I’m authenticated and I’m able to print to the browser developer console the Keycloak user ID and token. The token looks good to me after checking on https://jwt.io.

The problem is that for unknown reason, the Keycloak JavaScript adapter captures a “user is logged out” from the check-sso iframe after 1 minute despite the token still be valid for another 29 minutes.

I’m using the Keycloak JavaScript adapter wrongly?