Description
I'm investigating an issue reported by a Duende IdentityServer customer where they get occasional errors logged in IdentityServer on the token endpoint: "Transformed code verifier does not match code challenge"
The client application is typically opened in multiple tabs on the same time in the same browser.
Upon reviewing the logs I can see that this happens when the client makes two silent token renewals on the same time.
- Call A to authorize endpoint with code_challenge=X
- Call B to authorize endpoint with code_challenge=Y
- Call to token endpoint which results in "Transformed code verifier does not match code challenge". When we hash the code_verifier from this call, it matches code_challenge X, from call A to the authorize endpoint.
Right now we do not have logs of the generated authorization code from the responses from the authorize endpoints, but it looks like the code_verifier for call A to the authorize endpoint together with the authorization returned from B (or the other way around).
We have two questions:
- Is there a way when running the application in multiple tabs to prevent multiple refreshes running on the same time?
- Could there be a bug in the state handling in this library that mixes up the code_verifiers when there are two simultaneous calls?
Desktop (please complete the following information):
- Multiple browsers, both Safari and Chrome.