Skip to content

KNOX-3432: Advertise RFC 8693 token-exchange grant type in KnoxIDF discovery metadata - #1376

Open
smolnar82 wants to merge 2 commits into
apache:masterfrom
smolnar82:KNOX-3432
Open

KNOX-3432: Advertise RFC 8693 token-exchange grant type in KnoxIDF discovery metadata#1376
smolnar82 wants to merge 2 commits into
apache:masterfrom
smolnar82:KNOX-3432

Conversation

@smolnar82

Copy link
Copy Markdown
Contributor

KNOX-3432 - Advertise RFC 8693 token-exchange grant type in KnoxIDF discovery metadata

What changes were proposed in this pull request?

KnoxIDF supports OAuth 2.0 Token Exchange (RFC 8693), but its OIDC discovery document (.well-known/openid-configuration) only listed authorization_code and refresh_token in grant_types_supported. Per RFC 8414 §2 that field must list every grant type the server supports, so a spec-compliant reader would wrongly conclude token exchange is unavailable.

  • Added TOKEN_EXCHANGE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange" to KnoxIDFConstants (RFC 8693 §2.1, IANA-registered). Intentionally duplicated from JWTFederationFilter.TOKEN_EXCHANGE rather than shared; it's a fixed standard identifier, and duplicating avoids a module dependency on the JWT federation provider.
  • DiscoveryResource now includes this value in grant_types_supported.

How was this patch tested?

  • Extended DiscoveryResourceMetadataTest to assert the discovery document advertises all three grant types, including the token-exchange URN.
  • mvn -pl gateway-service-knoxidf test -Dtest=DiscoveryResourceMetadataTest: passes.

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

Looks good.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Test Results

  4 files    4 suites   16s ⏱️
 84 tests  84 ✅ 0 💤 0 ❌
102 runs  102 ✅ 0 💤 0 ❌

Results for commit 7e47f04.

♻️ This comment has been updated with latest results.

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

Have only one question on this.
Otherwise, looks good!

Comment thread .github/workflows/tests/test_knoxidf.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants