For information about where ADC looks for credentials and in what order, see How Application Default Credentials works.
If you are using API keys, then you don't need to set up ADC. For more information, see Use API keys to access APIs.
Provide credentials to ADC
Select the environment where your code is running:
The gcloud CLI and ADC
You can provide credentials to ADC by using the
gcloud auth application-default login command. This makes
credentials available to the Cloud Client Libraries and Google API Client Libraries.
The gcloud CLI itself doesn't use ADC to access Google Cloud resources. To learn how to provide credentials to the gcloud CLI, see Authentication for the gcloud CLI.
What's next
- Learn more about how ADC finds credentials.
- Authenticate for using Cloud Client Libraries.
- Authenticate for using REST.
- Explore authentication methods.