How you set up Application Default Credentials (ADC) for use by Cloud Client Libraries, Google API Client Libraries, and the REST and RPC APIs depends on the environment where your code is running.

<br />

For information about where ADC looks for credentials and in what order, see
[How Application Default Credentials works](https://docs.cloud.google.com/docs/authentication/application-default-credentials).

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](https://docs.cloud.google.com/docs/authentication/api-keys-use).

## Provide credentials to ADC

Select the environment where your code is running:

- [Local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment)

- [Resource with an attached service account](https://docs.cloud.google.com/docs/authentication/set-up-adc-attached-service-account)

- [Containerized environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-containerized-environment)

- [On-premises or another cloud provider](https://docs.cloud.google.com/docs/authentication/set-up-adc-on-premises)

- [Cloud-based development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-cloud-dev-environment)

## The gcloud CLI and ADC

You can provide credentials to ADC by using the
[`gcloud auth application-default login`](https://docs.cloud.google.com/sdk/gcloud/reference/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](https://docs.cloud.google.com/sdk/docs/authenticate).

## What's next

- Learn more about [how ADC finds credentials](https://docs.cloud.google.com/docs/authentication/application-default-credentials).
- [Authenticate for using Cloud Client Libraries](https://docs.cloud.google.com/docs/authentication/client-libraries).
- [Authenticate for using REST](https://docs.cloud.google.com/docs/authentication/rest).
- Explore [authentication methods](https://docs.cloud.google.com/docs/authentication).