gcloud auth application-default
Stay organized with collections
Save and categorize content based on your preferences.
- NAME
-
- gcloud auth application-default - manage your active Application Default Credentials
- SYNOPSIS
-
-
gcloud auth application-defaultCOMMAND[GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
Application Default Credentials (ADC) provide a method to get credentials used
in calling Google APIs. The gcloud auth application-default command group allows
you to manage active credentials on your machine that are used for local
application development.
These credentials are only used by Google client libraries in your own application.
For more information about ADC and how it works, see Authenticating as a service account.
- EXAMPLES
-
To use your own user credentials for your application to access an API, run:
gcloudauthapplication-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- Acquire new user credentials to use for Application Default Credentials.
print-access-token- Print an access token for your current Application Default Credentials.
revoke- Revoke previously generated Application Default Credentials.
set-quota-project- Update or add a quota project in application default credentials (ADC).
- NOTES
-
These variants are also available:
gcloudalphaauthapplication-defaultgcloudbetaauthapplication-default