[keycloak-user] Angular 2 with Webpack

ebondu dev.ebondu at gmail.com
Thu Feb 2 04:28:16 EST 2017


@Brian
I think you are trying to access these vars *before* the Keycloak component
has been initialized.
The global approach is to use Observables to be notified when states have
been updated.

For example, to get the user data, you should subscribe to the
"authenticatedObserver" and then use the "tokenParsed" field wich contains
the decoded JWT :

Keycloak.authenticatedObs.subscribe(auth => {
      if(auth) {
        console.info(Keycloak.tokenParsed.given_name);
      }
});

I will try to provide a basic example and a more detailed documentation
soon.



--
View this message in context: http://keycloak-user.88327.x6.nabble.com/keycloak-user-Angular-2-with-Webpack-tp2493p2568.html
Sent from the keycloak-user mailing list archive at Nabble.com.


More information about the keycloak-user mailing list