Skip to content

Leave client_id out of the body with client_secret_basic - #1653

Merged
helpcodeai merged 1 commit into
mainfrom
fix/oauth-basic-no-body-client-id
Nov 12, 2026
Merged

helpcodeai merged 1 commit into
mainfrom
fix/oauth-basic-no-body-client-id

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

What

With tokenAuthMethod: client_secret_basic, the token requests (code exchange in mcp-oauth.service.ts, refresh in oauth2-token.service.ts) no longer put client_id in the body next to the Basic header.

Why

Constant Contact's token endpoint is Okta. It refuses Basic plus a body client_id with 401 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 the oauth_failed events). The client authenticates in the header, so RFC 6749 §4.1.3 does not need client_id in the body, and the MCP TypeScript SDK sends client_secret_basic the 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 no client_id in the body.
  • mcp-oauth-callback.controller.spec.ts does not start locally because of a missing @types/picomatch in my local node_modules. That is a baseline failure (it happens without this change too); CI runs it.
  • Checked against the live Constant Contact token endpoint with a fake code. Old shape: 401 invalid_request (multiple client credentials). New shape: 400 invalid_grant, so the client authentication is accepted.

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.
@helpcodeai
helpcodeai merged commit 5972b0f into main Nov 12, 2026
17 checks passed
@helpcodeai
helpcodeai deleted the fix/oauth-basic-no-body-client-id branch November 12, 2026 21:53
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant