docs(mcp): fix OAuth quickstart to use prod client_id - #2136
Merged
Conversation
The mcp-remote --static-oauth-client-info blocks hardcoded the dev client sb-tutorials!t676072. Prod runs a distinct xsappname (tutorials-prod) in the same XSUAA tenant, so its OAuth client is sb-tutorials-prod!t676072. Against developers.sap.com the dev client_id + prod-owned Tutorial.MCP scope (emitted by the .well-known discovery) is rejected at /oauth/authorize as an invalid authorization request. Switch the example blocks to the prod client_id and add a dev/prod mapping table plus a cf env lookup so users pick the id matching their <base>.
…-uri whitelist Some mcp-remote builds bind the callback to the loopback IP 127.0.0.1 (RFC 8252's preferred default), producing http://127.0.0.1:<port>/oauth/callback. XSUAA matches redirect_uri literally and the client whitelists only http://localhost:*/oauth/callback, so the IP form fails at /oauth/authorize with 'redirect_uri does not match the configuration'. Pin --host localhost in both example blocks and add a troubleshooting note.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
MCP OAuth via
mcp-remotefails against production (developers.sap.com) with "The request for authorization was invalid" at/oauth/authorize. PAT auth is unaffected (it bypasses the authorize flow).Root cause
docs/end-users/mcp-quickstart.mdhardcodes the dev client in both--static-oauth-client-infoblocks:sb-tutorials!t676072.Dev and prod share one XSUAA tenant (
t676072), so prod.mtaext gives prod a distinct xsappnametutorials-prod→ OAuth clientsb-tutorials-prod!t676072. The runtime.well-known/oauth-authorization-serverdiscovery correctly advertises the prod-qualified scopetutorials-prod!t676072.Tutorial.MCP(derived from the bound VCAP xsappname).mcp-remotepairs that prod scope with the doc's devclient_id→ the dev client can't be granted a prod-owned scope → XSUAA rejects.tutorialssb-tutorials!t676072tutorials!t676072.Tutorial.MCPtutorials-prodsb-tutorials-prod!t676072tutorials-prod!t676072.Tutorial.MCPChange (docs only)
mcp-remoteexample blocks now use the prod client_idsb-tutorials-prod!t676072(the doc's default<base>is production).<base>→client_idmapping table with the failure symptom.cf envlookup to name both srv apps.Prod configuration and
.well-knowndiscovery are correct and unchanged.