Open svrooij opened 7 years ago
Working solution for me, in your app component when you initialize the service:
this.oauthService.loadDiscoveryDocument().then(() => {
this.oauthService.tryLogin({});
if (this.oauthService.getIdToken() == null) {
this.oauthService.initImplicitFlow();
}
});
this.oauthService.tryLogin({});
That works perfectly, but it looks wrong.
I agree at 100%, as always with oAuth/openID, a lot of magic :)
I'm trying to implement some sort of single-sign-on when the user loads the app but doesn't have a valid (access-/)identitytoken. How who we implement this?
We want to implement it so the user doesn't have to press the login button, they are probably already logged-in so they'll get a token instantly.
Where should I put the
initImplicitFlow()
call for this to happen?