I am trying to decipher the meaning "scopes" in the following error message from Error: Could not load the default credentials. context: firebase login:ci AND firebase auth:export:
[2021-04-27T20:48:23.188Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2021-04-27T20:48:26.208Z] Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.
at GoogleAuth.getApplicationDefaultAsync (/home/node/.npm-global/lib/node_modules/firebase-tools/node_modules/google-auth-library/build/src/auth/googleauth.js:160:19)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at runNextTicks (internal/process/task_queues.js:66:3)
at listOnTimeout (internal/timers.js:518:9)
at processTimers (internal/timers.js:492:7)
at async GoogleAuth.getClient (/home/node/.npm-global/lib/node_modules/firebase-tools/node_modules/google-auth-library/build/src/auth/googleauth.js:502:17)
at async GoogleAuth.getAccessToken (/home/node/.npm-global/lib/node_modules/firebase-tools/node_modules/google-auth-library/build/src/auth/googleauth.js:524:24)
Error: An unexpected error has occurred.
If I understood what "scopes" are I might be able to figure out where to set them. So far I have only found a place to set roles and permissions in the IAM for my user.
Here are the definitions I could find:
roles & permissions (source)
A role contains a set of permissions that allows you to perform specific actions on Google Cloud resources. To make permissions available to members, including users, groups, and service accounts, you grant roles to the members.
Access scopes are the legacy method of specifying permissions for your instance. They define the default OAuth scopes used in requests from the gcloud tool or the client libraries.
The error message arose when I tried to run firebase --debug auth:export
using an OAuth token generated by firebase login:ci
and applied in my script with firebase use --token
. The OAuth token was generated with the Google user id that owns my Firebase project. That user has role "Owner" on the Google Cloud IAM page (i.e. https://console.cloud.google.com/iam-admin/iam).
How do I set the required scopes for my Google user id when the Google Cloud IAM page only allows you to set roles and permissions?