Skip to content

KNOX-3308 - Token Exchange Flow using wrong param name#1211

Merged
smolnar82 merged 2 commits into
apache:masterfrom
lmccay:KNOX-3308
Apr 24, 2026
Merged

KNOX-3308 - Token Exchange Flow using wrong param name#1211
smolnar82 merged 2 commits into
apache:masterfrom
lmccay:KNOX-3308

Conversation

@lmccay
Copy link
Copy Markdown
Contributor

@lmccay lmccay commented Apr 22, 2026

KNOX-1234 - Token Exchange Flow using wrong param name

What changes were proposed in this pull request?

The Token Exchange flow param name is inconsistent with the core OAuth specification and requires both a full urn as the name and a hyphen rather than an underscrore: urn:ietf:params:oauth:grant-type:token-exchange

JWTFederationFilter is currently coded to expect a shortname with underscore 'token_exchange'.

In addition, UrlEncodedFormRequest wrapper has a brittle getParameter implementation that hard codes the names of params that we know indicate that the processing of the request body will be handled by us and there is not danger in consuming the response out from under another handler.

Since this is in a generic path, I want to move the knowledge of that out to the code that is handling the request processing rather than trying to keep this list in sync with the consuming code. I'll add a ServletRequestUtils to unwrap the servlet request so that we can get to the params ourselves within those specific code blocks and otherwise the wrapper will no longer treat any param names specially. This will also require the move of ServletRequestUtils to the gateway-spi module.

How was this patch tested?

Existing unit tests were corrected through the changes in the existing constants.
All unit tests were run and passed.

Integration Tests

none

@lmccay lmccay requested a review from smolnar82 April 22, 2026 23:52
@github-actions
Copy link
Copy Markdown

Test Results

21 tests   21 ✅  1s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 796b06a.

@smolnar82 smolnar82 merged commit e39a318 into apache:master Apr 24, 2026
3 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.

2 participants