Skip to content

fix(client): don't send client_id in token body under client_secret_b…#3175

Draft
manjunathbhaskar wants to merge 2 commits into
modelcontextprotocol:mainfrom
manjunathbhaskar:fix/basic-auth-client-id-body
Draft

fix(client): don't send client_id in token body under client_secret_b…#3175
manjunathbhaskar wants to merge 2 commits into
modelcontextprotocol:mainfrom
manjunathbhaskar:fix/basic-auth-client-id-body

Conversation

@manjunathbhaskar

Copy link
Copy Markdown

…asic

RFC 6749 section 2.3 requires that with HTTP Basic auth, client credentials must not also appear in the request body. prepare_token_auth stripped client_secret from the body for the client_secret_basic branch but left client_id in, so strict token endpoints (Keycloak, Okta in strict mode, and the RFC 6749 compliance test suite) reject the request as presenting two authentication methods at once.

Fixes #3138

Two existing tests asserted the old behavior explicitly, updated both to assert the corrected one, and added the same check to the refresh token test for symmetry.

Motivation and Context

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

manjunathbhaskar and others added 2 commits July 26, 2026 09:40
…asic

RFC 6749 section 2.3 requires that with HTTP Basic auth, client
credentials must not also appear in the request body. prepare_token_auth
stripped client_secret from the body for the client_secret_basic branch
but left client_id in, so strict token endpoints (Keycloak, Okta in
strict mode, and the RFC 6749 compliance test suite) reject the request
as presenting two authentication methods at once.

Fixes modelcontextprotocol#3138

Two existing tests asserted the old behavior explicitly, updated both to
assert the corrected one, and added the same check to the refresh token
test for symmetry.

Signed-off-by: manjunathbhaskar <manjunathbhaskar854@gmail.com>
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.

OAuth client sends client_id in token body under client_secret_basic (strict servers reject as multiple auth methods)

1 participant