Skip to content

fix(connections): make Google connector use real OAuth URL, not placeholder - #206

Merged
Rchari1 merged 1 commit into
local/amicodefrom
fix/google-real-oauth
Aug 14, 2026
Merged

fix(connections): make Google connector use real OAuth URL, not placeholder#206
Rchari1 merged 1 commit into
local/amicodefrom
fix/google-real-oauth

Conversation

@Rchari1

@Rchari1 Rchari1 commented Aug 14, 2026

Copy link
Copy Markdown
Member

Follow-up to #205 (already merged).

Confusion: #205's first iteration used https://accounts.google.com/signin as a placeholder to prove the browser wiring end-to-end. You flagged it correctly — the Google connector should be a real Google connector.

Fix: replaces the placeholder with the real authorization URL:

  • https://accounts.google.com/o/oauth2/v2/auth + scopes
    • googlegmail.readonly + userinfo.email (read an email)
    • google-drivedrive.file + spreadsheets + userinfo.email (create/populate a Sheet)
  • Reads GOOGLE_CLIENT_ID / GOOGLE_REDIRECT_URI (default http://127.0.0.1:8085/oauth/callback), generates state, access_type=offline&prompt=consent, and opens via the BROWSER-aware path (VS Code browser.sh → code --openExternal).

When no client is configured it still opens Google with ?error=missing_client_id rather than silently doing nothing — set the env and it does the full OAuth. No more placeholder confusion.

No new UI changes — the browser wiring from #205 is unchanged.

Summary by CodeRabbit

  • New Features

    • Google browser authentication now generates a complete OAuth authorization link when configured.
    • Requests appropriate access scopes and supports offline access with consent prompting.
    • Provides a clear configuration indication when a Google client ID is unavailable.
  • Bug Fixes

    • Replaced placeholder Google and Drive account links with functional authentication URLs.

…holder

Follow-up to #205 (already merged). The first iteration used
https://accounts.google.com/signin as a placeholder to prove the
browser wiring. This replaces it with the real
https://accounts.google.com/o/oauth2/v2/auth URL, scopes, and env
handling:

- google       → gmail.readonly + userinfo.email
- google-drive → drive.file + spreadsheets + userinfo.email

Reads GOOGLE_CLIENT_ID / GOOGLE_REDIRECT_URI (default loopback),
generates state, and opens the real consent screen via the
BROWSER-aware path. No more placeholder confusion.
@Rchari1
Rchari1 merged commit b24d43d into local/amicode Aug 14, 2026
0 of 5 checks passed
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 105699e9-3d33-4530-94a9-a33c339bdc1e

📥 Commits

Reviewing files that changed from the base of the PR and between 52e18cb and a6073b4.

📒 Files selected for processing (1)
  • packages/opencode/src/server/amicode/connections.ts

📝 Walkthrough

Walkthrough

Google browser authentication now builds a Google OAuth authorization URL from environment configuration. It includes connector-specific scopes, redirect URI, offline access, consent prompting, and generated state. Missing client configuration produces an explanatory fallback URL.

Changes

Google OAuth flow

Layer / File(s) Summary
Build Google authorization URL
packages/opencode/src/server/amicode/connections.ts
The browser authentication flow constructs connector-specific Google OAuth URLs with configured client and redirect values, scopes, state, offline access, and consent prompting. It uses a fallback URL when the client ID is unavailable. Browser opening remains best-effort.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: kateebonner

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/google-real-oauth

Comment @coderabbitai help to get the list of available commands.

@Rchari1
Rchari1 deleted the fix/google-real-oauth branch August 14, 2026 23:51
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.

1 participant