⚡ Sangsakala Proxy 🏠 Home
Skip to content

fix(google-auth-library): [cleanup] set iss from keyFile clientEmail - #9808

Open
feywind wants to merge 1 commit into
mainfrom
cleanup/gh9469-gtoken-keyfile-iss
Open

feywind wants to merge 1 commit into
mainfrom
cleanup/gh9469-gtoken-keyfile-iss

Conversation

@feywind

@feywind feywind commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

This is for the cleanup.

Description

Sets tokenOptions.iss from keyFile client_email when fetching GoogleToken credentials.

Impact

Fixes invalid_grant token errors when authenticating GoogleToken using a keyFile.

Changes

  • Set this.tokenOptions.iss = this.tokenOptions.iss || credentials.clientEmail in TokenHandler.processCredentials() when loading credentials from keyFile.
  • Add unit test coverage in test.tokenHandler.ts verifying iss is populated from keyFile and existing iss values are preserved.

Testing

  • Added unit test assertions in core/packages/google-auth-library-nodejs/test/gtoken/test.tokenHandler.ts.

Alternatives

  • Leaving TokenHandler.processCredentials() unchanged would continue causing GoogleToken instances configured with keyFile (without an explicit iss or email) to omit the iss claim in signed JWT assertions.

Fixes #9469

@feywind
feywind added this pull request to stack #9813 November 3, 2026 19:19

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a copyright header and updates the TokenHandler to set this.tokenOptions.iss to credentials.clientEmail if it is not already defined, along with corresponding unit tests. The review feedback suggests using the nullish coalescing operator (??) instead of the logical OR operator (||) to prevent overriding valid falsy values like an empty string.

@feywind
feywind marked this pull request as ready for review November 3, 2026 19:53
@feywind
feywind requested review from a team as code owners November 3, 2026 19:53
@feywind
feywind force-pushed the cleanup/gh9469-gtoken-keyfile-iss branch from 1841bc3 to ce9967b Compare November 3, 2026 20:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

google-auth-library: JWT with a JSON keyFile signs without iss since 10.6.1 (invalid_grant: account not found)

1 participant