Skip to content

feat: update MCP quickstart for On-Behalf-Of Token Exchange#1053

Merged
lrzhou25 merged 7 commits into
mainfrom
auth_for_mcp_ga_docs_clean
Apr 30, 2026
Merged

feat: update MCP quickstart for On-Behalf-Of Token Exchange#1053
lrzhou25 merged 7 commits into
mainfrom
auth_for_mcp_ga_docs_clean

Conversation

@lrzhou25
Copy link
Copy Markdown
Contributor

Summary

Updates the "Call Your API on a User's Behalf" MCP quickstart to reflect the new On-Behalf-Of (OBO) Token Exchange implementation, replacing the previous Custom Token Exchange approach.

Changes

JavaScript Updates (based on auth0-samples PR #79)

  • Sample folder: fastmcp-mcp-customtokenexchange-jsfastmcp-mcp-on-behalf-of-tokenexchange-js
  • Terminology: "Custom Token Exchange" → "On-Behalf-Of Token Exchange"
  • Environment variables:
    • Removed MCP_AUTH0_SUBJECT_TOKEN_TYPE
    • Simplified MCP_AUTH0_EXCHANGE_SCOPE from "openid offline_access read:private" to "read:private"
    • Fixed API_BASE_URL trailing slash
  • Token exchange implementation:
    • Function: exchangeCustomToken()exchangeTokenOnBehalfOf()
    • SDK method: getTokenByExchangeProfile()getTokenOnBehalfOf()
    • ApiClient uses AUTH0_AUDIENCE instead of API_AUTH0_AUDIENCE
    • Removed subjectTokenType parameter

Python Updates (based on auth0-samples PR #81)

  • Sample folder: fastmcp-mcp-customtokenexchange-pythonfastmcp-mcp-on-behalf-of-tokenexchange-python
  • Terminology: "Custom Token Exchange" → "On-Behalf-Of Token Exchange"
  • Token exchange implementation:
    • Function: exchange_custom_token()exchange_token_on_behalf_of()
    • SDK method: get_token_by_exchange_profile()get_token_on_behalf_of()
    • ApiClient uses AUTH0_AUDIENCE instead of API_AUTH0_AUDIENCE
    • Removed subject_token_type parameter

Additional Improvements

  • Added rate limit note for Auth0 for AI Agents add-on
  • Added client grant configuration instructions
  • Created OBO token exchange enablement component
  • Updated prerequisites with OBO-specific requirements

Files Changed

  • mcp/get-started/call-your-apis-on-users-behalf.mdx - Main quickstart page
  • snippets/mcp/get-started/call-your-apis/create-env-file.mdx - Environment setup
  • snippets/mcp/get-started/call-your-apis/exchange-access-token-js.mdx - JavaScript explanation
  • snippets/mcp/get-started/call-your-apis/exchange-access-token-python.mdx - Python explanation
  • snippets/mcp/get-started/pre-reqs/enable-obo-token-exchange.mdx - New OBO enablement component
  • snippets/mcp/get-started/pre-reqs/prerequisites.mdx - Updated prerequisites

Testing

  • Verify JavaScript quickstart instructions work with new sample code
  • Verify Python quickstart instructions work with new sample code
  • Verify all code snippets are accurate
  • Verify links to sample repos are correct
  • Test OBO token exchange flow end-to-end

🤖 Generated with Claude Code

Updates the "Call Your API on a User's Behalf" quickstart to reflect
the new On-Behalf-Of (OBO) Token Exchange implementation.

JavaScript changes (PR #79):
- Update sample folder: fastmcp-mcp-on-behalf-of-tokenexchange-js
- Replace Custom Token Exchange with On-Behalf-Of terminology
- Simplify environment variables (remove MCP_AUTH0_SUBJECT_TOKEN_TYPE)
- Update token exchange: exchangeTokenOnBehalfOf() using getTokenOnBehalfOf()
- Simplify MCP_AUTH0_EXCHANGE_SCOPE to "read:private"

Python changes (PR #81):
- Update sample folder: fastmcp-mcp-on-behalf-of-tokenexchange-python
- Replace Custom Token Exchange with On-Behalf-Of terminology
- Update token exchange: exchange_token_on_behalf_of() using get_token_on_behalf_of()

Additional improvements:
- Add rate limit note for Auth0 for AI Agents add-on
- Add client grant configuration instructions
- Add OBO token exchange enablement component
- Update prerequisites with OBO-specific requirements

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lrzhou25 lrzhou25 requested review from a team as code owners April 27, 2026 21:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Summary

Status Count
🔍 Total 6
✅ Successful 2
⏳ Timeouts 0
🔀 Redirected 1
👻 Excluded 3
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 0

Redirects per input

Redirects in auth4genai/mcp/get-started/call-your-apis-on-users-behalf.mdx

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 27, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
auth0-genai 🟢 Ready View Preview Apr 27, 2026, 9:44 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Comment thread auth4genai/mcp/get-started/call-your-apis-on-users-behalf.mdx Outdated
Comment thread auth4genai/mcp/get-started/call-your-apis-on-users-behalf.mdx Outdated
Comment thread auth4genai/mcp/get-started/call-your-apis-on-users-behalf.mdx
Comment thread auth4genai/mcp/get-started/call-your-apis-on-users-behalf.mdx
priley86
priley86 previously approved these changes Apr 28, 2026
@priley86
Copy link
Copy Markdown
Contributor

approved changes from this side, but please do defer until these quickstarts are merged. ty so much for this update @lrzhou25 ! 🙇

Comment thread auth4genai/mcp/get-started/call-your-apis-on-users-behalf.mdx Outdated
BcnCarlos
BcnCarlos previously approved these changes Apr 30, 2026
@lrzhou25 lrzhou25 merged commit efd3e04 into main Apr 30, 2026
6 checks passed
@lrzhou25 lrzhou25 deleted the auth_for_mcp_ga_docs_clean branch April 30, 2026 17:21
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.

4 participants