Repository navigation
fix(google): sign in with the scope a Workspace admin delegated, and say which scope is missing - #704
Merged
Merged
Conversation
…say which scope is missing Google matches domain-wide delegation scopes exactly: a client delegated all of Gmail was refused gmail.readonly and gmail.compose, and the source's error was cut at 300 characters before the fix. A service account acting as someone now falls back to the broader scope the admin gave (google_auth.COVERS); when Google still refuses, Lens asks scope by scope and names what the delegation lacks, what it allows and the exact list to paste. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KVJvqdsH8dv8fo642tN9LG
A unit launched at NOW and let go through the API at the real time ran for days once the calendar passed NOW, spent the group's $20 budget and kept the next tick from launching, so the test failed on main from 2026-10-20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KVJvqdsH8dv8fo642tN9LG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: a Gmail source signing in as a Workspace service account that acts as a user failed with "Google refused to let … act as …: a Workspace admin gives client id … domain-wide delegation for gmail.readonly,gmail.compose (Admin console › Sec", even when the admin had delegated Gmail to that client. Google matches delegated scopes exactly, so a client delegated all of Gmail (
https://mail.google.com/, which backup tools such as the one this key belongs to ask for) is refusedgmail.readonly; and the health error was cut at 300 characters, so the fix never showed.After: a service account acting as someone that Google refuses (
unauthorized_client) tries once more with the broader scope that covers what it asked for (google_auth.COVERS: all of Gmail, Calendar or Drive); Lens still makes only the narrower scope's calls. When that is refused too, Lens asks Google one scope at a time and the error names the scopes the delegation lacks, the ones it allows, the client id and the exact comma-separated list to paste, plus Google's own words. Health errors keep up to 1,000 characters.Motivation and Context
Adeel's Gmail connection through a service account kept failing with delegation he says is allowed.
Steps to reproduce (if appropriate):
Delegate only
https://mail.google.com/(or onlygmail.readonly) to a service account's client id, then add a Gmail source with that key, a user andwrite: yes.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.changelog.d/.Done questions (AGENTS.md)
google.tokenrow in the activity ledger; no model calls.test_gmail_source.py: missing compose named, all-of-Gmail delegation works), docs (docs/processing.md), threat model YAML/JSON updated with the prose._form/_swap.Generated by Claude Code