Skip to content

Fix OAuth token_endpoint_auth_method to comply with OpenID Connect spec #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gavi
Copy link

@gavi gavi commented Jul 30, 2025

This PR fixes the OAuth client authentication method to comply with the OpenID Connect specification by changing token_endpoint_auth_method from "none" to "client_secret_basic".

Motivation and Context

The current implementation hardcodes token_endpoint_auth_method as "none" in the client metadata, which violates the OpenID Connect specification. According to the spec, the default value should be "client_secret_basic". This incorrect value causes dynamic client registration to fail during the token generation phase because:

  1. Clients register with token_endpoint_auth_method: "none"
  2. The authorization server expects proper client authentication during token exchange
  3. The mismatch between registered auth method and actual requirements causes token requests to fail

How Has This Been Tested?

  • Tested OAuth flow with dynamic client registration
  • Verified successful token generation after the fix
  • Confirmed compatibility with OpenID Connect compliant authorization servers

Breaking Changes

This is a non-breaking change that fixes incorrect behavior. Existing implementations that were somehow working with "none" may need to ensure their authorization servers support client_secret_basic authentication, but this is the standard expected behavior.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the [MCP Documentation](https://modelcontextprotocol.io)
  • 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

This change aligns the MCP Inspector with the OpenID Connect Core 1.0 specification (Section 9), which defines client_secret_basic as the default authentication method for confidential clients. The fix ensures proper client authentication during the OAuth 2.0 authorization code flow, preventing token exchange failures that were occurring with the previous "none" setting.

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.

1 participant