Skip to content
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

auth/IdTokenClient should respect eagerRefreshThresholdMillis while checking token expiry #1554

Closed
AyushWalekar opened this issue May 25, 2023 · 0 comments · Fixed by #1555
Closed
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@AyushWalekar
Copy link
Contributor

Environment details

  • google-auth-library version: 8.8.0

Issue

Since IdTokenClient extends OAuth2Client, it expected to respect eagerRefreshThresholdMillis value and fetch new idToken within 5 minute of expiry date by default.

Because current check is: (this.credentials.expiry_date || 0) < Date.now()
Ref: https://github.com/googleapis/google-auth-library-nodejs/blob/main/src/auth/idtokenclient.ts#L55

Steps to reproduce

  1. Create instance of IdTokenClient with expiry_date
  2. It doesn't respect default eagerRefreshThresholdMillis value i.e. 5 minutes before token is about to expire. Rather it fetches new token only after it's expired.

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

@AyushWalekar AyushWalekar added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels May 25, 2023
@danielbankhead danielbankhead self-assigned this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants