Skip to content

feat: add on_behalf_of_token_exchange support to client token_exchange schema #1366

Merged
ankita10119 merged 4 commits intomasterfrom
DXCDT-1576
Apr 23, 2026
Merged

feat: add on_behalf_of_token_exchange support to client token_exchange schema #1366
ankita10119 merged 4 commits intomasterfrom
DXCDT-1576

Conversation

@ankita10119
Copy link
Copy Markdown
Contributor

This PR extends the Auth0 Deploy CLI to support the On-Behalf-Of (OBO) Token Exchange feature, which allows MCP servers and backend APIs to exchange an incoming user-bound access token for a new token scoped to a downstream first-party API, preserving user identity (sub) and actor attribution (act)

🔧 Changes

The token_exchange object on clients was introduced to support Custom Token Exchange (custom_authentication). OBO Token Exchange reuses the same client-level toggle mechanism but targets a different flow: instead of exchanging an external/custom token, the MCP server exchanges an Auth0-issued access token (scoped to itself) for a short-lived token scoped to a downstream API.

src/tools/auth0/handlers/clients.ts

Adds on_behalf_of_token_exchange as a valid value in the token_exchange.allow_any_profile_of_type enum in the client JSON schema:

  • enum: ['custom_authentication']
  • enum: ['custom_authentication', 'on_behalf_of_token_exchange']

This allows tenant configurations managed via Deploy CLI to declare the OBO toggle on a client, enabling it to perform token exchanges using the urn:ietf:params:oauth:grant-type:token-exchange grant type.

test/tools/auth0/handlers/clients.tests.js

Adds two new test cases covering the full lifecycle of the new profile type

📚 References

🔬 Testing

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ankita10119 ankita10119 requested a review from a team as a code owner April 17, 2026 10:27
@ankita10119 ankita10119 marked this pull request as draft April 17, 2026 10:27
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.15%. Comparing base (6856564) to head (e162951).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1366   +/-   ##
=======================================
  Coverage   80.15%   80.15%           
=======================================
  Files         152      152           
  Lines        6319     6319           
  Branches     1328     1328           
=======================================
  Hits         5065     5065           
  Misses        708      708           
  Partials      546      546           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ankita10119 ankita10119 marked this pull request as ready for review April 20, 2026 11:23
@ankita10119 ankita10119 merged commit 4f9dd1c into master Apr 23, 2026
9 checks passed
@ankita10119 ankita10119 deleted the DXCDT-1576 branch April 23, 2026 06:55
@ankita10119 ankita10119 mentioned this pull request Apr 23, 2026
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.

3 participants