-
Notifications
You must be signed in to change notification settings - Fork 383
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
eagerRefreshThresholdMillis doesn't work for JWTClient and service accounts #774
Comments
I am seeing intermittent 401s as well mostly when hitting |
I got the following error: |
@aaleksandrov one small issue with your sample code, I believe I was being returned tokens that expire after 8 hours (rather than 50 minutes) so to confirm that this bug is fixed, you'll want to use a larger eager refresh setting ... Having said this, there was a major bug with eager refresh, which your reproduction brought to our attention, please try |
Looks like #794 should fix the issue. I cannot verify it immediately because the issues mostly happened in production (don't want to break production but we have some logs in place so I'll keep an eye) |
@aaleksandrov 👍 please feel free to reopen this if you do continue to see issues; thanks for the bug report and great reproduction. |
Environment details
google-auth-library
version: 5.1.2Steps to reproduce
Code to reproduce:
I added some logging to
OAuth2Client
. This is output:So as I can see
google-auth-library
tries to refresh a token (and makes calls to Google Oauth2 API) but Google keeps returning the same access_token till it gets expired. Problem here is that eventually a few requests to GCP fail with 401 causing intermittent issues like googleapis/nodejs-common#430 and googleapis/nodejs-bigquery#473This is log from my Bigquery issue
I added some logs in google-auth-library and what I got:
Is it a proper Google Oauth2 API behaviour? Can it be fixed on
google-auth-library
side? This issue is quite annoying and forces us make workarounds :(The text was updated successfully, but these errors were encountered: