Skip to content

gcloud auth application-default login

gcloud auth application-default login is a command used to authorize the Google Cloud SDK for Application Default Credentials (ADC). This process allows client libraries and other tools to authenticate API requests without manually specifying service account credentials.^[400-devops__05-Cloud-Provider__GCP.md]

Execution Process

When executed, the command initiates an OAuth 2.0 flow by opening the default web browser to a Google accounts authorization URL.^[400-devops__05-Cloud-Provider__GCP.md] The user is prompted to log in and grant the necessary permissions. Upon successful authentication, the obtained credentials are saved locally to a file named application_default_credentials.json.^[400-devops__05-Cloud-Provider__GCP.md]

Quota Project Configuration

A crucial aspect of this login method is the association of a quota project. If credentials are authenticated without a specified quota project, Google Cloud SDK may issue a warning indicating potential "quota exceeded" or "API not enabled" errors.^[400-devops__05-Cloud-Provider__GCP.md] To resolve this, the command allows a quota project (e.g., unistar-dev-v1) to be added to the ADC configuration, which is then used by Google client libraries for billing and quota purposes.^[400-devops__05-Cloud-Provider__GCP.md]

Sources

  • 400-devops__05-Cloud-Provider__GCP.md