-
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
Two token refresh requests use the same refresh token #733
Comments
Hmm.... Don't have any immediate thoughts or solutions, but you could try with the just released v9 of the library, that should have a lot of changes/fixes around code flow too I think? (Haven't tried v9 yet myself though.) |
Do you already use version 9 of this lib? We've fixed a bug regarding this in version 9. |
@jeroenheijmans @manfredsteyer Thank you for your reply. No, I'm using v8.0.4. And at the moment I can't update to Angular 9 which is required for v9. I have found this comment in an other issue: #722 (comment) We changed the order and call now |
FWIW: I can confirm that's what I also do in all my applications. |
@goflo : Version 9 should also work with Angular 8. I guess I should point this out in the readme. @jeroenheijmans : This issue with the right order of these called really gives me a hard time. Can you have a short look into the new quickstart-demo. Here I have this order and it works. Can you tell me what I have to do here to run into this very issue? |
I cannot reproduce this behavior. I think the order of things in the quickstart-demo is fine (though it doesn't include any automatic or timed refreshes, just when you hit the button). Even if I setup a I cannot reproduce it in my own sample repository either, unless.... you'd use a version before the commit where I compensate for #600 (no silent refresh via iframe available with code flow). In that case, my sample even for v8 will show an errorred out refresh that was happening because I prefer to try iframe-based refreshed at the start of my app. Maybe OP was experiencing that behavior? @goflo could you check if you initiate Otherwise, we'll probably need a repository or a StackBlitz example to further investigate... |
@manfredsteyer : thanks for the info regarding v9 and Angular 8! @jeroenheijmans : no, I don't initiate a silentRefresh(). As I wrote above we are calling Thanks for your time! |
Describe the bug
We are using IdentityServer4 with the angular-oauth2-oidc library. Authorization is done using Code-Flow and automatic refresh is enabled calling setupAutomaticSilentRefresh method. Login is working fine. Before the token expires the automatic refresh kicks in and refreshes the token. Normally that works fine. We get a new token and everything works. But sometimes two refresh token requests (R1 and R2) are sent at the same point in time and both use the same refresh token (RT). Request R1 is successful and we get a new fresh token from IdentityServer. But R2 fails because IdentityServer already generated a new refrsh token and the old refresh token (RT) is not valid anymore! The following request are working fine again.
Anyone who knows that issue? Any ideas how to solve it?
Do I need the silent-refresh.html page and setting the
silentRefreshRedirectUri
(for code-flow!) as described in this example: https://github.com/jeroenheijmans/sample-auth0-angular-oauth2-oidcTo Reproduce
Steps to reproduce the behavior:
I haven't found a way to reproduce it. I just do the following steps:
Desktop (please complete the following information):
IdentityServer Log:
Successful refresh token request (R1) with refresh token d5290....8401:
![image](https://user-images.githubusercontent.com/1143339/75958363-5c158c00-5ebc-11ea-9107-2c01423185b4.png)
Failed refresh token request (R2) with refresh token d5290....8401 at "same time" as R1:
![image](https://user-images.githubusercontent.com/1143339/75960709-d34d1f00-5ec0-11ea-86b5-5b1c41647ce9.png)
Log output in the console:
![image](https://user-images.githubusercontent.com/1143339/75960821-15766080-5ec1-11ea-845a-c5e41b5b78e5.png)
In the console "Error performing password flow" is printed as error. Why password flow? We use code-flow and never start a password flow.
Maybe related to this issue?
#722
#724
The text was updated successfully, but these errors were encountered: