Skip to content

fix(auth): accept IAP issuer when verifying id tokens - #7279

Merged
dbolduc merged 1 commit into
googleapis:mainfrom
akasakariko:fix-idtoken-iap-issuer
Oct 23, 2026
Merged

dbolduc merged 1 commit into
googleapis:mainfrom
akasakariko:fix-idtoken-iap-issuer

Conversation

@akasakariko

Copy link
Copy Markdown
Contributor

Summary

  • Accept the Cloud IAP issuer when verifying ID tokens
  • Keep the existing Google account issuers

Reproduction

  • Added an ES256 token with the Cloud IAP issuer to the unmodified verifier
  • Observed an invalid issuer error for that token: JWT token iss field is invalid: InvalidIssuer
  • Confirmed the same failure at revision 34d0868 on macOS with Rust 1 99 1

Verification

  • The new regression test passes with the fix
  • All 14 verifier tests pass
  • All 51 idtoken tests pass
  • clippy with warnings denied passes
  • One unrelated test, credentials::mds::tests::adc_overridden_mds, fails with a 502 from the metadata host in this environment, and it fails the same way at the baseline revision

Fixes #6704

The id token verifier only accepted the Google account issuers so tokens
issued by Identity-Aware Proxy were rejected with an invalid issuer error

IAP signs its tokens with ES256 and uses the Cloud IAP issuer which is now
part of the accepted issuer list

Add regression coverage using an ES256 token with the IAP issuer

Fixes googleapis#6704
@akasakariko
akasakariko requested review from a team as code owners October 23, 2026 08:07

@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 support for verifying Identity-Aware Proxy (IAP) signed ID tokens by adding https://cloud.google.com/iap to the list of accepted issuers in the verifier. It also introduces a helper function generate_test_id_token_es256_with_claims in the test module to facilitate testing ES256 tokens with custom claims, and adds a unit test verifying successful validation of IAP-issued tokens. I have no feedback to provide on these changes.

@alvarowolfx

Copy link
Copy Markdown
Contributor

/gcbrun

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.53%. Comparing base (34d0868) to head (adea0f0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7279      +/-   ##
==========================================
- Coverage   97.53%   97.53%   -0.01%     
==========================================
  Files         332      332              
  Lines      139867   139895      +28     
==========================================
+ Hits       136419   136444      +25     
- Misses       3448     3451       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alvarowolfx alvarowolfx 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.

LGTM, thanks

@dbolduc
dbolduc merged commit c9b59f2 into googleapis:main Oct 23, 2026
43 of 44 checks passed
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.

ID token verifier hardcodes issuer to accounts.google.com, rejecting IAP tokens

3 participants