Repository navigation
Leave client_id out of the body with client_secret_basic - #1653
Merged
Merged
Conversation
Okta token endpoints (Constant Contact) refuse a body client_id next to the Basic header as "Cannot supply multiple client credentials", so every Constant Contact authorization failed at the code exchange. The client authenticates in the header, so client_id is not needed in the body (RFC 6749 4.1.3); the MCP SDK sends Basic the same way. Applies to the code exchange and to refresh.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
With
tokenAuthMethod: client_secret_basic, the token requests (code exchange inmcp-oauth.service.ts, refresh inoauth2-token.service.ts) no longer putclient_idin the body next to the Basic header.Why
Constant Contact's token endpoint is Okta. It refuses Basic plus a body
client_idwith401 invalid_request: Cannot supply multiple client credentials, so every Constant Contact authorization failed at the code exchange (a customer hit it twice on 2026-11-12, see theoauth_failedevents). The client authenticates in the header, so RFC 6749 §4.1.3 does not needclient_idin the body, and the MCP TypeScript SDK sendsclient_secret_basicthe same way. Secret placement and the post, none and private_key_jwt paths are unchanged.Cloud and self-hosted
Same behaviour in both modes. It affects every connector whose token auth is Basic: about 25 catalog adapters and remote MCP servers registered with
client_secret_basic.Tests
packages/backend:npx jest src/connectors/mcp-oauth.service.spec.ts src/connectors/engines/oauth2-token.service.spec.ts: 2 suites, 116 tests pass. Both Basic cases now assert there is noclient_idin the body.mcp-oauth-callback.controller.spec.tsdoes not start locally because of a missing@types/picomatchin my local node_modules. That is a baseline failure (it happens without this change too); CI runs it.401 invalid_request(multiple client credentials). New shape:400 invalid_grant, so the client authentication is accepted.