-
Notifications
You must be signed in to change notification settings - Fork 18
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
Bug: prevent concurrent access token refresh attempts #29
Comments
Prevent multiple concurrent token refresh calls if multiple GitLab API calls are triggered while token is expired. For more info, see issue I submitted here: BitySA/oauth2-auth-code-pkce#29
Prevent multiple concurrent token refresh calls if multiple GitLab API calls are triggered while token is expired. For more info, see issue I submitted here: BitySA/oauth2-auth-code-pkce#29
Prevent multiple concurrent token refresh calls if multiple GitLab API calls are triggered while token is expired. For more info, see issue I submitted here: BitySA/oauth2-auth-code-pkce#29 Fixes 200ok-ch#739.
For additional context, check out the linked PR in organice: 200ok-ch/organice#740 |
Thank you again for your explanation and suggested fix! I've just been really busy the past months. Bity development team is practically 2 people for the past year, and yeah, I'm leaving now, so this may not see any updates for awhile. I know personally if I ever need an OAuth2 solution though, I'll be using this one I've created 🙂 |
Making multiple fetch calls using
OAuth2AuthCodePKCE.decorateFetchHTTPClient(fetch)
while the access token is expired will result in multiple token refresh calls. Unfortunately this causes issues such asinvalid_grant
error responses and potentially even rate limiting. For example, gitlab.com rate limits this particular API call to 10 requests/minute.Here's how I worked around the issue, but it would be ideal to implement this in your library instead:
Note: the
onAccessTokenExpiry
workaround was the important part for the specific scenario I encountered, but I think it makes sense to do inonInvalidGrant
too.The text was updated successfully, but these errors were encountered: