AUT-13975: feat: support requested_token_type and pre-signed jwt-bearer assertions - #159
Open
mschaab-SA wants to merge 3 commits into
Open
AUT-13975: feat: support requested_token_type and pre-signed jwt-bearer assertions#159mschaab-SA wants to merge 3 commits into
mschaab-SA wants to merge 3 commits into
Conversation
Neither parameter that Cross-App Access needs was reachable. Token exchange could not ask for an ID-JAG, and jwt-bearer always signed its own assertion from --assertion, which holds claims to sign rather than a token. requested_token_type is left unvalidated, unlike the adjacent subject and actor token types: RFC 8693 section 2.1 makes it an open URI namespace, so a oneof would mean editing this tool whenever a draft mints a new type. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A pre-signed assertion leaves request.SigningKey nil, so the flow printed a bare "Signing key" heading with nothing under it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mschaab-SA
requested review from
ikawalec,
jdabrowski and
mbilski
as code owners
August 19, 2026 18:12
mschaab-SA
commented
Aug 19, 2026
mschaab-SA
left a comment
Contributor
Author
There was a problem hiding this comment.
Automated review (Claude Code). 7 findings, ranked by severity — the top two were verified empirically (built binary / mutation testing) against this branch. Each inline comment is self-contained and actionable.
…tion Give the client assertion its own key field so it can no longer be attributed to a grant assertion the client never signed, move the nil handling into LogKey, validate the two new flags before any request is sent, and widen the subject/actor token type lists to cover the ID-JAG draft's id_token subject. Tests: share the form-capturing server, and assert that an unset --assertion-jwt really signs locally - the previous test passed on any error, including a dial failure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Jira: AUT-13975
Problem
oauth2cimplements both the token-exchange and jwt-bearer grants, but neither parameter that Cross-App Access needs was reachable, so it could not drive either leg of the flow:requested_token_type. The parameter appears nowhere in the repo, so the minting leg could not ask for an ID-JAG.jwt-beareralways minted its own assertion.RequestTokensignsAssertionClaims(...)with--signing-keyand sets that asassertion. Redeeming an ID-JAG means presenting a JWT somebody else signed, and there was no way to supply one.--assertioncould not be reused for the second case: it isvalidate:"omitempty,json"and holds claims to sign, so a raw JWT both fails validation and means the wrong thing.Changes
--requested-token-typesetsrequested_token_typeon the token-exchange grant.--assertion-jwtsupplies a pre-signed assertion, used verbatim, bypassingSignJWT.LogAssertionno longer prints a bareSigning keyheading when nothing was signed locally — the same!= nilguard already used a few lines above.requested_token_typeis deliberately left without avalidatetag, unlike the neighbouringSubjectTokenType/ActorTokenTypeoneof=s. RFC 8693 section 2.1 makes it an open URI namespace, so pinning the accepted values would mean editing this tool every time a draft mints a new token type.Verification
Both legs driven end to end against a local SecureAuth CIAM server with the
id_jagfeature flag on — two tenants, the minting workspace on token-exchange and the redeeming workspace on jwt-bearer:A pleasant side effect of routing the grant through the existing
assertionform field:LogAssertionalready decodes and pretty-prints it, so the ID-JAG's claims show up in the flow output without any extra work.Also verified the grant is refused (
id_jag_audience_mismatch) when replayed at a different resource server, and that it can be redeemed repeatedly within its lifetime — both per the draft.Unit tests cover the new form values and the pass-through, including that an unset
--assertion-jwtstill takes the signing path.