Skip to content

fix: add openid to OAuth SCOPES to unblock auth flow - #3

Merged
MrBenJ merged 3 commits into
mainfrom
fix/openid-scope
May 21, 2026
Merged

fix: add openid to OAuth SCOPES to unblock auth flow#3
MrBenJ merged 3 commits into
mainfrom
fix/openid-scope

Conversation

@MrBenJ

@MrBenJ MrBenJ commented May 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Append "openid" to SCOPES in src/multi_google_mcp/config.py.
  • Google implicitly grants openid whenever userinfo.email is requested. oauthlib raises the resulting scope-set divergence as a Warning (via its warnings-as-errors path), aborting multi-google-mcp-auth add before the token is written.
  • One-line config edit — keeps requested and granted scope sets aligned; no behavior change in API access (we don't consume the OIDC id_token).

Test plan

  • uv run pytest — 88 passed.
  • uv run ruff check . — All checks passed.
  • uv run mypy — Success: no issues found in 14 source files.
  • uv tool install --reinstall . — installed multi-google-mcp and multi-google-mcp-auth.
  • multi-google-mcp-auth add personal — completed without oauthlib exception. Token file written at ~/.config/multi-google-mcp/accounts/personal.json with mode 0o600 and scopes [calendar, drive, gmail.modify, userinfo.email, openid].

Notes

  • Per CLAUDE.md, changing SCOPES requires every existing account to be re-added. Only personal exists locally; it was re-added as the verify step.
  • Spec: docs/superpowers/specs/2026-05-20-openid-scope-fix-design.md. Plan: docs/superpowers/plans/2026-05-20-openid-scope-fix.md.

🤖 Generated with Claude Code

MrBenJ and others added 3 commits May 20, 2026 21:03
Add a brainstorm design doc describing the single-line addition of
"openid" to config.SCOPES to unblock multi-google-mcp-auth add against
oauthlib's scope-change-as-Warning behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task-by-task plan for the single-line config edit, reinstall, and
end-to-end auth-flow verification against the personal account.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Google implicitly grants the openid scope whenever userinfo.email (or
any identity-bearing scope) is requested. oauthlib treats the resulting
scope-set divergence as a Warning, which it raises as an exception via
its warnings-as-errors path, aborting multi-google-mcp-auth add before
the token is written to disk.

Adding "openid" to the requested set keeps requested and granted
aligned, silencing oauthlib without changing the API access we actually
hold (we don't consume the OIDC id_token).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@aria-teknal-studio aria-teknal-studio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings.

I reviewed the PR in code-review mode with emphasis on OAuth/auth behavior, security regressions, compatibility, config assumptions, and test coverage.

The runtime change is limited to adding openid to config.SCOPES, which is consistent with Google returning that scope alongside userinfo.email and should keep oauthlib's requested/granted scope comparison aligned. I did not find an authz expansion beyond the OIDC identity scope already implied by the userinfo email flow, and the code does not persist or consume an ID token.

Residual risk: CI covers the static surface and existing mocked auth CLI path, but it still cannot prove the real browser-based Google OAuth callback path. I verified locally:

  • uv run pytest -> 88 passed
  • uv run ruff check . -> passed
  • uv run mypy -> passed

The live multi-google-mcp-auth add <label> OAuth flow should remain the final verification gate for this fix.

@MrBenJ
MrBenJ merged commit afcb116 into main May 21, 2026
1 check passed
@MrBenJ
MrBenJ deleted the fix/openid-scope branch May 21, 2026 04:17
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.

2 participants