[keycloak-user] Node Adapter check logout

Tom Barber tom at spicule.co.uk
Tue Feb 26 05:03:39 EST 2019


Hi folks,

Trying to figure this one out….

If I login to my NodeJS based web app in a web browser I get prompted to
login and do so and the Keycloak adapter seems to initialise itself
correctly etc.

Then for example, I go to bed but leave the browser window open, after a
while, Keycloak will close down the session, as you’d expect. But if you
rerun kc.init:

kc.init({ onLoad: 'check-sso', token, refreshToken })
  .success(authenticated => {
    if (authenticated) {
      debugger;
      SkinStore.kc = kc;
      store.getState().keycloak = kc;
      store.dispatch(setCurrentUser(kc));
      updateLocalStorage();
      ReactDOM.render(<App/>, document.getElementById('root'));

    } else {
      debugger;
      console.log('Error to authenticate');
      ReactDOM.render(<App/>, document.getElementById('root'));

    }
  })

It returns authenticated = true, yet I can look in the Keycloak server and
see there are no active sessions for that client.

Yet I can also see the iframe check to:
https://auth.testdomain.co.uk/auth/realms/skinparison/protocol/openid-connect/login-status-iframe.html/init?client_id=skin&origin=http%3A%2F%2Flocalhost%3A5000
<https://auth.spicule.co.uk/auth/realms/skinparison/protocol/openid-connect/login-status-iframe.html/init?client_id=skin&origin=http%3A%2F%2Flocalhost%3A5000>
returns
a 204 and seems happy.

What am I missing here?

I’m testing in a private chrome window against a test Keycloak server and
everything else seems okay, if I shut the tab and open a new one I get
prompted to log back in etc

Thanks

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