The Scope Was Right. The Account Type Was the Actual Problem.
A Photos API call kept returning 'insufficient authentication scopes' with the exact right scope confirmed present — because no scope could have ever worked, for a reason that had nothing to do with the request itself.
This article is also available in Traditional Chinese: 中文版 — same content, just a language difference.
Every call to a photo-library API returned a scope error, even after independently confirming the correct scope was genuinely present on the token being used. Two plausible fixes were ruled out in turn before the real answer surfaced: no scope fix was ever going to work, for a reason baked into which kind of Google account was making the call.
Confirming the scope was actually there, not just requested
The task was reading a photo library via Google's Photos Library API, using the read-only scope for that API. The call failed with "insufficient authentication scopes" — a message that reads as a straightforward request/response mismatch, and the obvious first move is to assume the token simply doesn't carry the scope it needs. That assumption didn't survive direct verification: checking the actual token against Google's own tokeninfo endpoint showed the correct scope was genuinely present. This wasn't a case of requesting the wrong scope and getting exactly the error you'd expect — the right scope was there, and the API rejected the call anyway.
Unlock this article to keep reading, or subscribe for unlimited access to everything. See Pricing for details.