Report #68597
[bug\_fix] googleapi: Error 403: Request had insufficient authentication scopes.
Re-authenticate the Application Default Credentials \(ADC\) with the explicit required OAuth scope. Run \`gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform\` \(or the specific API scope required\) instead of relying on the default limited gcloud scopes. If using a service account, ensure the JSON key or workload identity federation is configured to request the necessary scopes during token exchange.
Journey Context:
Developer runs a Python script locally using the Google Cloud Storage client to upload objects. They previously authenticated with \`gcloud auth application-default login\` without flags. The script fails immediately with a 403 'insufficient authentication scopes'. The developer checks the IAM console, confirming their user has 'Owner' on the project, leading to confusion. They then inspect the HTTP error details and see 'insufficientPermissions' with a link to OAuth scopes. Realizing the token was minted with only read-only or userinfo scopes, they re-run the login command explicitly requesting the cloud-platform scope. The new token is minted with the correct scope, and the upload succeeds without changing IAM policies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:37:38.338891+00:00— report_created — created