fix(oauth): add client id to token exchange

Merge https://github.com/google/adk-python/pull/2805

fixes #2806
add client id to token request, adhering to [RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3)

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2805 from davidkl97:fix/oauth-exchange-token 3366dce65ce4dd4fee649a81ab7e486689637442
PiperOrigin-RevId: 840369113
This commit is contained in:
davidkl97
2025-12-04 13:09:11 -08:00
committed by Copybara-Service
parent 2b64715505
commit f2735177f1
2 changed files with 2 additions and 0 deletions
@@ -196,6 +196,7 @@ class OAuth2CredentialExchanger(BaseCredentialExchanger):
),
code=auth_credential.oauth2.auth_code,
grant_type=OAuthGrantType.AUTHORIZATION_CODE,
client_id=auth_credential.oauth2.client_id,
)
update_credential_with_tokens(auth_credential, tokens)
logger.debug("Successfully exchanged authorization code for access token")
@@ -341,6 +341,7 @@ class TestOAuth2CredentialExchanger:
authorization_response="https://example.com/callback?code=auth_code", # Normalized URI
code="auth_code",
grant_type=OAuthGrantType.AUTHORIZATION_CODE,
client_id="test_client_id",
)
@pytest.mark.asyncio