Set up Application Default Credentials
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.
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:
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[[["Application Default Credentials (ADC) setup varies depending on the environment where your code is executed."],["ADC is used by Cloud Client Libraries, Google API Client Libraries, and REST and RPC APIs, but API keys do not require ADC setup."],["ADC setup instructions are provided for local development, resources with attached service accounts, containerized environments, on-premises or other cloud providers, and cloud-based development environments."],["You can review documentation to better understand the order in which ADC finds credentials."],["You can find further documentation on authenticating using cloud client libraries, REST, and other authentication methods."]]],[]]