| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…secret_basic Same issue as #3138, in the independent identity_assertion.py (SEP-990 jwt-bearer) implementation: client_id was always placed in the request body and never stripped for client_secret_basic, even though it's already presented via the Authorization header. RFC 6749 §2.3 requires it not appear in both places. Fixes #XXXX
| Back | FazBrowse Home | New Git URL |
Description
IdentityAssertionOAuthProvider._build_token_request() in
src/mcp/client/auth/extensions/identity_assertion.py has the same issue as #3138
(fixed for the main OAuthContext.prepare_token_auth()), in its own independent
implementation: client_id is unconditionally placed in the request body, and is
never removed when token_endpoint_auth_method == "client_secret_basic" — even
though it's already presented via the Authorization: Basic header at that point.
RFC 6749 §2.3 requires that with Basic auth, client credentials not also appear in
the body. Strict token endpoints (Keycloak, Okta in strict mode) reject a request
that presents credentials both ways.
Where
Proposed fix
Move client_id into the else (client_secret_post) branch alongside
client_secret, so it's only added to the body for the post method — matching the
fix already applied to OAuthContext.prepare_token_auth for #3138.
I have a fix + tests ready and would like to submit a PR (disclosed: drafted with
AI assistance, reviewed and understood by me).