Files
google-mcp/auth
Baris Sencan 3361ed29e6 Fix PKCE code verifier not being generated for initial OAuth flow
When `create_oauth_flow()` is called without an explicit `code_verifier`
(i.e. during the initial auth flow in `start_auth_flow()`), the function
never sets `autogenerate_code_verifier=True` on the Flow constructor.

oauthlib 3.2+ automatically adds `code_challenge` to the authorization
URL at the session level, so Google expects a matching `code_verifier`
during the token exchange. However, since `Flow.code_verifier` remains
`None`, that `None` gets stored in the session store and later passed
back during the callback — causing Google to reject the token exchange
with `(invalid_grant) Missing code verifier`.

The fix adds `autogenerate_code_verifier=True` in the else branch so
the Flow object generates and exposes a proper PKCE code verifier that
gets stored and reused during the callback token exchange.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 18:38:29 +00:00
..
2025-12-13 13:49:28 -08:00
2026-02-24 11:23:22 -04:00
2026-02-07 13:35:32 -05:00
2026-02-28 10:06:50 -04:00
2026-02-10 17:22:28 -05:00
2026-02-05 11:17:59 -05:00
2025-12-13 13:49:28 -08:00
2026-02-28 16:17:43 -04:00
2026-02-24 21:09:14 -04:00