modelcontextprotocol / modelcontextprotocol/php-sdk

[Client] Support token_endpoint_auth_method: client_secret_basic, client_secret_post, none

Open
#321 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auth Client enhancement improves spec compliance
Dominant language
PHP
Stars
1.6k
Forks
173
Avg merge
2d 49m
Merged PRs (30d)
23

Description

Context

Per RFC 6749 §2.3 (and AS metadata token_endpoint_auth_methods_supported), the client must send its credentials to the token endpoint using whichever method the AS advertises:

  • client_secret_basic → HTTP Basic Authorization: Basic base64(client_id:client_secret)
  • client_secret_post → form-encoded client_id + client_secret body params
  • none → public client; only client_id in body, no secret

Scope

  • Strategy interface TokenEndpointAuthInterface + three implementations.
  • Auto-select implementation based on AS metadata's preferred method (intersect with what the client supports/has).

Conformance scenarios unblocked

auth/token-endpoint-auth-basic, auth/token-endpoint-auth-post, auth/token-endpoint-auth-none.

Dependencies

Blocked by: #318, #319.

Acceptance

  • Unit tests per strategy.
  • Conformance: 3 baseline scenarios pass.

cc @soyuka

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the TokenEndpointAuthInterface scope and the work in dependencies #318 and #319, then trace how AS metadata exposes token_endpoint_auth_methods_supported. Use the auth/token-endpoint-auth-basic, auth/token-endpoint-auth-post, and auth/token-endpoint-auth-none conformance scenarios alongside unit tests; done means all three strategies are covered and the three baseline scenarios pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.