[keycloak-user] Javascript Check SSO and Token Validity

Tom Barber tom at spicule.co.uk
Fri Mar 1 13:15:43 EST 2019


Hi folks,

I need some help understanding the flow a bit to make sure I can explain
stuff, or just figure out if things are wired up correctly.

Using the Javascript adapter we login using Check SSO to check the validity
of the session. My developer then has a token validity check in place

    keycloak
          .updateToken(
            KC_UPDATE_TOKEN_INTERVAL / 1000 /* 1s = 1000 milliseconds */
          )
          .success(refreshed => {
            if (refreshed) {
              console.log('Token was successfully refreshed');
              updateLocalStorage(keycloak);
            } else {
              console.log('Token is still valid');
            }
          })
          .error(() => {
            // Failed to refresh the token, or the session has expired
            keycloak.logout();
          });

This runs on a timer. But, if you terminate a session in key cloak it
doesn’t log you out( we also have the checkLoginIframe disabled).

So, if checking the token a valid way of detecting a session? And what’s
the deal with terminating your session?

Thanks and apologies for the relatively dumb question!

Tom

-- 


Spicule Limited is registered in England & Wales. Company Number: 
09954122. Registered office: First Floor, Telecom House, 125-135 Preston 
Road, Brighton, England, BN1 6AF. VAT No. 251478891.




All engagements 
are subject to Spicule Terms and Conditions of Business. This email and its 
contents are intended solely for the individual to whom it is addressed and 
may contain information that is confidential, privileged or otherwise 
protected from disclosure, distributing or copying. Any views or opinions 
presented in this email are solely those of the author and do not 
necessarily represent those of Spicule Limited. The company accepts no 
liability for any damage caused by any virus transmitted by this email. If 
you have received this message in error, please notify us immediately by 
reply email before deleting it from your system. Service of legal notice 
cannot be effected on Spicule Limited by email.


More information about the keycloak-user mailing list