Skip to content

Fix OIDC ID token exchange token type#19450

Open
xfocus3 wants to merge 2 commits into
spring-projects:mainfrom
xfocus3:gh-19448-oidc-token-type
Open

Fix OIDC ID token exchange token type#19450
xfocus3 wants to merge 2 commits into
spring-projects:mainfrom
xfocus3:gh-19448-oidc-token-type

Conversation

@xfocus3

@xfocus3 xfocus3 commented Jul 15, 2026

Copy link
Copy Markdown

Fixes gh-19448.

This maps OidcIdToken to urn:ietf:params:oauth:token-type:id_token when building token exchange request parameters. The default converter continues to use the existing fallback for other token classes.

Regression coverage checks OIDC ID tokens used as both subject_token and actor_token.

Signed-off-by: Ahmed El amraouiyine <amraouiyine@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 15, 2026
@shin1488

shin1488 commented Jul 15, 2026

Copy link
Copy Markdown

The mapping is correct. The description is not.

"That correctly maps Jwt to urn:ietf:params:oauth:token-type:jwt" is the part gh-19436 (open, linked from gh-19448) disputes. RFC 8693 section 3 defines ...:jwt for sending a JWT to a different authorization server, and ...:access_token for a token issued by the authorization server being called — both arrive as a Jwt, so the Java type cannot tell them apart. The reference documentation's own token exchange example is the second case, where this mapping sends ...:jwt, and Ping (gh-16486) and Keycloak reject it.

defaultParameters() also calls tokenType() for actor_token_type, and convertWhenGrantRequestIsTokenExchangeThenParametersProvided in this file already asserts it for a Jwt actor token. The new test passes null as the actor token, so the OidcIdToken actor case — which this change also alters — is not covered.

gh-19436 has the rest: widening the mapping closes one identifier and leaves the application no more able to state one than before. gh-19076 is adding a resolver strategy for this same identifier on the authorization server side — this is the opposite shape on the client side. This PR does not close gh-19436.

Signed-off-by: Ahmed El amraouiyine <amraouiyine@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TokenExchangeGrantRequest sends an OidcIdToken subject token as ...:access_token

3 participants