gcloud alpha auth application-default Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha auth application-default - manage your active Application Default Credentials
- SYNOPSIS
gcloud alpha auth application-defaultCOMMAND[GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Application Default Credentials (ADC) provide a method toget credentials used in calling Google APIs. The gcloud alpha authapplication-default command group allows you to manage active credentials onyour machine that are used for local application development.These credentials are only used by Google client libraries in your ownapplication.
For more information about ADC and how it works, seeAuthenticating asa service account.
- EXAMPLES
- To use your own user credentials for your application to access an API, run:
gcloudalphaauthapplication-defaultloginThis will take you through a web flow to acquire new user credentials.
To create a service account and have your application use it for API access,run:
gcloudiamservice-accountscreatemy-accountgcloudiamservice-accountskeyscreatekey.json--iam-account=my-account@my-project.iam.gserviceaccount.comexportGOOGLE_APPLICATION_CREDENTIALS=key.json./my_application.sh - GCLOUD WIDE FLAGS
- These flags are available to all commands:
--help.Run
$gcloud helpfor details. - COMMANDS
is one of the following:COMMANDlogin(ALPHA)Acquire new user credentials to use for Application DefaultCredentials.print-access-token(ALPHA)Print an access token for your current Application DefaultCredentials.revoke(ALPHA)Revoke previously generated Application DefaultCredentials.set-quota-project(ALPHA)Update or add a quota project in application defaultcredentials (ADC).
- NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudauthapplication-defaultgcloudbetaauthapplication-default
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 2025-05-07 UTC.