Report #4052
[bug\_fix] google.api\_core.exceptions.Forbidden: 403 Request had insufficient authentication scopes when using Application Default Credentials
Run \`gcloud auth application-default login --scopes="https://www.googleapis.com/auth/cloud-platform"\` to generate new ADC credentials with the full cloud-platform scope. The root cause is that \`gcloud auth application-default login\` \(without --scopes\) grants only openid and userinfo.email scopes, which are insufficient for GCS or BigQuery API calls. The GCP client libraries use the ADC to build a token, but the OAuth2 token lacks the necessary scope to access the resource.
Journey Context:
A data engineer runs a Python script using \`google-cloud-storage\` on their laptop. The script fails with "Forbidden 403 insufficient authentication scopes". They verify they are authenticated via \`gcloud auth list\`, which shows the correct account. They check \`gcloud config get-value project\`, which matches. Confused, they set \`export GOOGLE\_APPLICATION\_CREDENTIALS\` to a service account key, and the script works. Realizing the issue is with their personal user credentials \(ADC\), they unset the env var and inspect the ADC file at \`~/.config/gcloud/application\_default\_credentials.json\`. They see the \`scope\` field lacks \`cloud-platform\`. They discover that \`gcloud auth application-default login\` defaults to minimal scopes. They re-run with \`--scopes=https://www.googleapis.com/auth/cloud-platform\`, and the script succeeds because the new token includes the necessary OAuth scope to access GCS buckets.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:44:26.523076+00:00— report_created — created