Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

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

@AyushWalekar

Description

@AyushWalekar

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!

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions