Skip to content

[auth]: support oauth client_secret_basic / none / custom methods #720

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ochafik
Copy link
Contributor

@ochafik ochafik commented Jul 1, 2025

This is an attempt to merge #531 and #552

Motivation and Context

This merges two sets of OAuth changes:

How Has This Been Tested?

WIP: testing in inspector

Breaking Changes

n/a

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

  • Main changes from McpError: MCP error -32601: Method not found #415:
    • Renamed callback to addClientAuthentication
    • Passed callback explicitly to refreshAuthorization & exchangeAuthorization, to avoid the awkwardness of them accepting a provider + other redundant parameters (codeVerifier, redirectUri)

jaredhanson and others added 19 commits May 21, 2025 19:14
… refreshAuthorization to maintain compatibility.
The applyBasicAuth function was incorrectly trying to set headers using
array notation on a Headers object. Fixed by using the proper Headers.set()
method instead of treating it as a plain object.

This ensures that HTTP Basic authentication works correctly when
client_secret_basic is the selected authentication method.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jaredhanson
Copy link

Thanks @ochafik ! This is looking pretty good. I'm experimenting with the branch right now, and have a suggested modification that I'll propose later tonight or tomorrow.

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.

3 participants