Skip to content

fix: store calendar OAuth credentials after authentication - #692

Open
anxkhn wants to merge 1 commit into
a2aproject:mainfrom
anxkhn:fix/calendar-agent-store-oauth
Open

fix: store calendar OAuth credentials after authentication#692
anxkhn wants to merge 1 commit into
a2aproject:mainfrom
anxkhn:fix/calendar-agent-store-oauth

Conversation

@anxkhn

@anxkhn anxkhn commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #275.

The calendar agent only cached exchanged OAuth credentials when RequestContext.call_context.user.is_authenticated was true. The documented /authenticate callback has no bearer JWT, so _complete_auth_processing skipped _store_user_auth and later requests prompted for authorization again.

This change makes _complete_auth_processing store credentials after a successful callback and updates _store_user_auth to use session.user_id, matching the key used by _ensure_auth. It also adds a regression test covering an unauthenticated callback and verifying that the session credential is cached.

Tested with:

uv run --no-sync pytest samples/python/agents/birthday_planner_adk/calendar_agent/tests/test_store_user_auth.py --verbose

@anxkhn
anxkhn force-pushed the fix/calendar-agent-store-oauth branch 2 times, most recently from 3535094 to f5dc2cb Compare August 25, 2026 18:04
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
@anxkhn
anxkhn force-pushed the fix/calendar-agent-store-oauth branch from f5dc2cb to 40e6174 Compare August 25, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: _store_user_auth() is never called after OAuth flow completes in calendar_agent/adk_agent_executor.py

1 participant