auth/IdTokenClient should respect eagerRefreshThresholdMillis while checking token expiry #1554
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.
Environment details
google-auth-library
version: 8.8.0Issue
Since
IdTokenClient
extendsOAuth2Client
, it expected to respecteagerRefreshThresholdMillis
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
IdTokenClient
with expiry_dateeagerRefreshThresholdMillis
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!
The text was updated successfully, but these errors were encountered: