Set up Application Default Credentials

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

For information about where ADC looks for credentials and in what order,seeHow Application Default Credentials works.

If you are using API keys, then you don't need to set upADC. For more information, seeUse API keys to access APIs.

Provide credentials to ADC

Select the environment where your code is running:

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.