Commit d2f5b60
committed
fix(oauth): remove redundant client_id from token exchange request body
Authlib's OAuth2Session already handles client_id placement for all
token_endpoint_auth_method values (client_secret_basic puts it in the
Authorization header, client_secret_post and none put it in the body).
Passing client_id as a kwarg to fetch_token causes it to be added to
the POST body unconditionally via prepare_token_request, in addition
to whatever the auth method does. This breaks providers like Slack
that infer auth method from the presence of client_id in the body,
and causes duplicate client_id for client_secret_post.
Partially reverts f273517 (PR #2805), which was based on a
misreading of RFC 6749 §4.1.3 — client_id in the body is only
REQUIRED "if the client is not authenticating with the authorization
server as described in Section 3.2.1."
Made-with: Cursor1 parent ffe97ec commit d2f5b60
2 files changed
Lines changed: 4 additions & 2 deletions
File tree
- src/google/adk/auth/exchanger
- tests/unittests/auth/exchanger
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
196 | 200 | | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
202 | 206 | | |
203 | | - | |
204 | 207 | | |
205 | 208 | | |
206 | 209 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
347 | 346 | | |
348 | 347 | | |
349 | 348 | | |
| |||
0 commit comments