Replies: 12 comments 23 replies
-
would you be able to share some of your code/configuration? We are using this technique at work together with IDS4 and works fine. So it must be some misconfiguration on your side. 400 means bad request, so might be sending something that is not supposed to be sent or something similar. |
Beta Was this translation helpful? Give feedback.
-
The 400 error is because the second request is attempting to use an already redeemed refresh token. This behaviour is experienced when configuring the client in Identity Server to only allow one-time refresh tokens. RefreshTokenUsage = OneTimeOnly I believe the issue is the double call to get the refresh token (maybe a double call to JWT callback in NextAuth?) I will put together a project demoing the issue and follow up on the thread here |
Beta Was this translation helpful? Give feedback.
-
My work seems to be facing the same issue and @balazsorban44, you seem to be onto something in regards to the I've attempted to reproduce this (repo here) which uses Demo IdentityServer4 as the auth provider and I've outlined the steps in the If you have a look, you can see that in the first attempt to retrieve the new tokens (by clicking the I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I started to think that the current tutorial doesn't actually handle the token rotation very well... I think we might need a new endpoint that makes sure that we always return a fresh |
Beta Was this translation helpful? Give feedback.
-
Someone found a potential issue that can lead to this problem! #2071 It is similar to what I found, there is a race condition happening. Either from the same tab or different ones. |
Beta Was this translation helpful? Give feedback.
-
I've the same issue. And what i've found is that when the token gets renewed at Opened an issue #2129 for this, as this is huge problem for those who is using the |
Beta Was this translation helpful? Give feedback.
-
Any update on this? Its been a long time and I cant find anything that solves it :( |
Beta Was this translation helpful? Give feedback.
-
@avisra The problem related with twice render pages (for me), I resolve it strictMode: false in next.config.js module.exports = nextConfig; |
Beta Was this translation helpful? Give feedback.
-
@HarunKilic @avisra @balazsorban44 We are experiencing this problem when using identity server 4 or 6. Have you found a solution? |
Beta Was this translation helpful? Give feedback.
-
Any update on this ? |
Beta Was this translation helpful? Give feedback.
-
Any update on this? This is still a recuring issue it seems :/ |
Beta Was this translation helpful? Give feedback.
-
Check my solution out: |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I setup the refresh token rotation copying the code form the tutorials section. However, on page refresh after the expiration... my refresh token is failing, and by adding console.logs to the different areas in the code, I determined that it is calling refreshAccessTokens two times (back to back, rapid fire, with the same refresh token). The first response is successful - the second response is not. And its the second response which fails everything because after the first request - it invalidates the refresh token - so the second one fails.
Steps to reproduce
Setup the refresh token example with IdentityServer4 as the provider.
Additional context
Using IdentityServer4 as the provider
Beta Was this translation helpful? Give feedback.
All reactions