Skip to content

auth add: consent hangs after Allow (qu7pO returns [13] INTERNAL) unless include_granted_scopes is removed #1334

Open

Description

@ericlu-sys

Summary

Since ~2026-11-12, gog auth add for a Google Workspace account hangs on the Google consent screen: after clicking Allow the page spins forever (sometimes shows 400. That's an error. The server cannot process the request because it is malformed.). The loopback callback never receives a request.

Removing include_granted_scopes=true from the generated auth URL (everything else unchanged, PKCE included) makes consent succeed immediately. There is currently no flag to disable that parameter for normal (full-scope) auth.

Environment

  • gog v0.48.0 (also reproduced on v0.11.0 before upgrading)
  • macOS (Darwin 24.6), Chrome 157 and Safari
  • Google Workspace account, OAuth client type Desktop, consent screen user type Internal
  • Same account + same GCP project + same client worked with gog auth add on 2026-11-11

What the browser receives

Captured with Chrome NetLog. The consent submit RPC returns HTTP 200 with an INTERNAL error payload (sensitive values omitted):

POST https://accounts.google.com/_/OAuthUi/data/batchexecute?rpcids=qu7pO&source-path=%2Fsignin%2Foauth%2Fv3%2Fconsent&...&bl=boq_identity-oauth-http_20261110.03_p0
-> HTTP 200
)]}'
[["wrb.fr","qu7pO",null,null,null,[13],"generic"],["di",81],["af.httprm",80,"<omitted>",40]]
[["e",4,null,null,141]]

Console shows Uncaught (in promise) RpcError. Note the consent UI build label boq_identity-oauth-http_20261110.03, which lines up with when this started.

What we ruled out

All of these still failed with [13] while include_granted_scopes=true was present:

  • different browsers / incognito / fresh Chrome profile
  • different networks (incl. VPN)
  • Workspace "Google Cloud session control" set to never require reauth; app marked Trusted in Admin console
  • a brand-new OAuth Desktop client in the same project
  • scopes narrowed to calendar only (--services calendar)
  • gog v0.11.0 → v0.48.0 (with S256 PKCE)

Control: gws auth login with the same client and project succeeds. Its URL does not send include_granted_scopes. Google's own gcloud auth login --force also succeeds for the same account.

Workaround

gog auth add <email> --client <name> --services gmail,calendar,drive,sheets --force-consent --remote --step 1
# delete "&include_granted_scopes=true" from the printed URL, open it, click Allow
gog auth add <email> --client <name> --services gmail,calendar,drive,sheets --force-consent --remote --step 2 --auth-url '<callback url>'

Two small papercuts seen along the way:

  1. If auth list still has the account but the keyring token is gone, step 2 fails with Secret not found in keyring (refresh token missing) until gog auth remove <email> is run.
  2. Step 2 returns manual auth state mismatch unless its flags match step 1 exactly (e.g. --force-consent).

Request

An opt-out such as gog auth add --no-include-granted-scopes (or an env/config switch) so users can avoid this without hand-editing the URL. internal/googleauth/oauth_flow.go already supports DisableIncludeGrantedScopes; it is only enabled for readonly/narrowed modes today.

This looks like a Google-side regression in merging prior grants, so the root cause may not be in gog, but the flag would make it recoverable.

Activity

  1. ericlu-sys commented on Nov 13, 2026

    @ericlu-sys
    Author

    A/B confirmation, same account / client / gog v0.48.0, ~20 minutes apart:

    • ~11:00 (UTC+8): URL from --remote --step 1 with &include_granted_scopes=true removed → Allow succeeds, step 2 stores the token.
    • ~11:10: identical flow, URL left unmodified (include_granted_scopes=true, PKCE S256 present) → spinner again; NetLog shows the same response:
    POST .../_/OAuthUi/data/batchexecute?rpcids=qu7pO&source-path=%2Fsignin%2Foauth%2Fv3%2Fconsent...
    -> HTTP 200
    [["wrb.fr","qu7pO",null,null,null,[13],"generic"],["di",41],["af.httprm",40,"<omitted>",37]]
    

    So it is not a transient Google outage that happened to clear; the parameter alone flips the result for this account.

  2. added
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    P2Normal priority bug or improvement with limited blast radius.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.
    impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    and removed
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    on Nov 13, 2026
  3. clawsweeper commented on Nov 13, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open: the reporter provides a controlled consent failure on v0.48.0, current main retains the triggering parameter, and the merged follow-up explicitly excludes this issue.

    Reproducibility: The reporter supplies a controlled affected-account A/B reproduction on v0.48.0; current source confirms the parameter-generation path, but this review did not reproduce Google's consent failure.

    Maintainer decision needed

    • Question: Should full-scope authorization gain an explicit incremental-grant opt-out, or should installed-app flows omit the parameter by default?
    • Recommendation: Add an explicit opt-out: Expose the existing internal capability across browser and remote auth, define state matching, and validate successful consent with unchanged scopes on the affected account.
    • Why: The reporter's A/B result supports omission, and Google's desktop guide excludes incremental authorization, but existing tests and documentation preserve incremental grants for full-scope reauthorization.

    Next step
    Choose the full-scope opt-out contract, then establish URL and remote-state regressions and confirm consent succeeds on the affected account.

    Security
    None.

    Review details

    Best possible solution:

    Provide a supported full-scope authorization path that omits incremental grants while preserving PKCE, state validation, and existing grant metadata.

    Do we have a high-confidence way to reproduce the issue?

    The reporter supplies a controlled affected-account A/B reproduction on v0.48.0; current source confirms the parameter-generation path, but this review did not reproduce Google's consent failure.

    Is this the best way to solve the issue?

    An explicit opt-out is the narrower compatibility change; Google's desktop OAuth guide confirms incremental authorization is unsupported for installed apps, but does not establish the reported backend failure's cause.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The provider-side hang has not been independently reproduced on current main.
    • Removing incremental authorization by default changes documented full-grant behavior; an opt-out requires an explicit interface and remote-state compatibility decision.

    Codex review notes: model internal, reasoning medium; reviewed against 6d97417eade9.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P2: A concrete account-specific authorization failure has a verified reporter workaround, with no evidence of broad service disruption.
    • impact:auth-provider: Google consent never returns the callback needed to obtain a refresh token.
    • impact:ux-friction: Recovery requires manually editing the authorization URL and completing matching remote steps.
    Evidence reviewed

    Acceptance criteria:

    • go test ./internal/cmd ./internal/googleauth
    • make ci
    • Confirm affected-account consent and token storage with unchanged full-service scopes and include_granted_scopes omitted.

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 14, 2026, 12:33 PM ET / 17:33 UTC.

  4. ericlu-sys commented on Nov 13, 2026

    @ericlu-sys
    Author

    Likely root cause from Google's own docs: the installed/desktop-app guide (https://developers.google.com/identity/protocols/oauth2/native-app) states "Incremental authorization is not supported for installed apps or devices", and include_granted_scopes is not in that page's parameter list. gog sends it by default for Desktop (installed) clients via authURLParams in internal/googleauth/oauth_flow.go.

    Google appears to have tolerated it until around 2026-11-12; with the current consent backend it now fails as qu7pO → [13] "generic" instead of a clear invalid_request. Suggest not sending include_granted_scopes for installed-app clients (or at least exposing an opt-out). gws and gcloud auth login omit it and work for the same account/client.

  5. added
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    and removed
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions