-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
force refresh session, new API #730
Conversation
fixes #729 |
I just tried this and it doesn't appear to be reloading the Id Token even though my setup is set to auto-load the id. And getPayloadFromIdToken() isn't causing a refresh either so I don't know how I could manually reload the id token in this case. (I'd also expect that checkAuth would have fired when it changed like I'd expect a silentRenew would do too in the same case) |
It's an async method, just in case, add a subscribe to force the call? I use it like this: Can you compare? Also you can check in the F12. Just wondering, do you have the silent renew active? Greetings Damien |
Here's how I'm calling it: const result = await this.oidcSecurityService.forceRefreshSession().toPromise(); result = true; No event fired for the auth change, and no update of the id_token. Here's my config: I see the silent-renew.html
|
Hi @JohnGalt1717 Your code looks good. would it be possible to supply an example? Greetings Damien |
If you take the link you provided above and replace console.log with: const userData = this.oidcSecurityService.getPayloadFromIdToken(); You'll see that any changes to the id_token won't be reflected with a call from getPayloadFromIdToken(), but if you look in localStorage and decode the id_token in xxx_authorizationDataIdToken it does have it. Here's the general flow:
Preferably it would be:
So I'd say that the bug is that getIdFromToken still has a cached copy even though it was updated and stored elsewhere so it never gets the new version, and the forceRefreshSession doesn't compare the auth and id tokens it gets back and then call checkAuth if they aren't the same. (doesn't matter about the content, only that they're not identical) |
Thanks |
Note, I think this is a timing issue caused by something that is observable/async not being awaited. If I put a breakpoint after the forceRefreshSession and wait a few seconds, and then use getIdFromToken it is updated. |
@JohnGalt1717 moved the issue here: I think you just need to wait for it to come back. We have a notification event. |
No description provided.