Feat: ID-JAG Refreshable - #3428
Open
mlajkim wants to merge 8 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
⚠️ Not ready to approve
The updated test JWK setup assumes RSA keys and can throw a ClassCastException under EC-key configurations, which should be made algorithm-safe before merging.
Pull request overview
Adds support for refreshing an existing ID-JAG (Identity Assertion Grant) token via the OAuth2 token-exchange endpoint in ZTS, allowing services authenticated with mTLS to renew an ID-JAG without re-supplying the original ID token.
Changes:
- Introduces a new
JAG_TOKEN_REFRESHrequest type inAccessTokenRequestand routes it throughZTSImpl.postAccessTokenRequest. - Implements
processJAGTokenRefreshRequestinZTSImplto re-mint a ZTS-signed ID-JAG while preserving the original grant (scope/claims) and enforcing mTLS service authentication and client binding. - Extends token support utilities/tests to preserve custom claims during refresh and adds end-to-end refresh test coverage.
File summaries
| File | Description |
|---|---|
| servers/zts/src/main/java/com/yahoo/athenz/zts/ZTSImpl.java | Adds the ID-JAG refresh handler and shares common JAG audience/client validation helpers. |
| servers/zts/src/main/java/com/yahoo/athenz/zts/token/AccessTokenRequest.java | Adds JAG_TOKEN_REFRESH and request validation/parsing for refresh semantics. |
| servers/zts/src/test/java/com/yahoo/athenz/zts/ZTSImplAccessTokenTest.java | Adds an integration-style test for issuing and refreshing ID-JAG, plus JWK processor setup tweaks. |
| servers/zts/src/test/java/com/yahoo/athenz/zts/token/AccessTokenRequestTest.java | Adds unit tests verifying refresh request classification and invalid-parameter handling. |
| libs/java/auth_core/src/main/java/com/yahoo/athenz/auth/token/OAuth2Token.java | Adds a helper to copy custom (non-standard) claims from a validated token. |
| libs/java/auth_core/src/test/java/com/yahoo/athenz/auth/token/AccessTokenTest.java | Adds coverage to ensure custom claims copying is preserved through re-signing. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mlajkim
marked this pull request as ready for review
July 22, 2026 05:24
mlajkim
marked this pull request as draft
July 24, 2026 01:59
Member
Author
|
Signed-off-by: Jeongwoo Kim - jekim <jekim@lycorp.co.jp>
Signed-off-by: Jeongwoo Kim - jekim <jekim@lycorp.co.jp>
mlajkim
force-pushed
the
feat/idjag-refresh
branch
from
July 25, 2026 06:09
c793077 to
5a72bee
Compare
Signed-off-by: Jeongwoo Kim - jekim <jekim@lycorp.co.jp>
mlajkim
marked this pull request as ready for review
August 5, 2026 08:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Athenz ID-JAGs can outlive the original IdP session, so requiring users to authenticate again frequently can be impractical. This Athenz-specific extension renews an unexpired ID-JAG using the authenticated service’s X.509 certificate.
What's done
you can now refresh the idjag, with
subject_token_type=id-jag:the original
auth_timeis kept when refreshing.athenz.zts.jag_token_refresh_max_timeoutsets the maximum refresh window from that time (30 days by default), and the expiry still uses the shortest allowed timeout.Contribution Checklist:
Attach Screenshots (Optional)