-
Notifications
You must be signed in to change notification settings - Fork 693
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
Improve behavior when setupAutomaticSilentRefresh is called *after* loadDiscoveryDocument methods #724
Comments
Wow! That's a... thorough analysis 😅. I'm not sure if I'll personally have time on the short term to think/debug along, but maybe some other community member does? On a side note, at this time it's sad there's no good test coverage. Would've been good to verify your assumptions with (marble) tests. |
Thanks for this analysis. Can you help me to reproduce this issue with one of our example applications? |
Hi, yes, I will have some time this next weeks. Sadly, this corona-virus crisis is bringing me to stand-down on some projects I had on the keyboard. |
Quick update; I have been able to dedicate yesterday to this and am hoping to do it today as well. |
I believe I have found the culprit of the problem. Please, bear with me as I try to explain it.
Then, the login is performed by invoking Problem: So far all things are all right and once the timer triggers, the application will request a new token using the refresh token that was received with the original token. Still, there are some oddities which makes the process a bit none-deterministic. For example, in the method However, if we refresh the page after the user has login. Because the Oauth service is initialized again, the configuration is processed again. There are some guards in the methods to account for an existing token. Not in Therefore, the next expiration will trigger two requests to the server. The server honours the two requests and responds with two new JWT with identical id and access token but with different refresh token. Only one of the refresh tokens is valid of course. I can reproduce this every time and it is easily fixed by adding Fix:
A bit dirty but solves the problem... The subscriptions are a bit messy in general without much synchronization. For example, the method Hope this helps you guys. |
Any feedback on this? |
This fix the issue here: manfredsteyer#724
In #722 we uncovered that calling
setupAutomaticSilentRefresh()
after e.g.loadDiscoveryDocumentAndTryLogin()
can cause weird behaviors down the line. See the linked issue for those situations.This issue proposes we improve this by either:
The text was updated successfully, but these errors were encountered: