gcloud_beta_auth_application-default_login (1)
NAME
- gcloud beta auth application-default login - acquire new user credentials to use for Application Default Credentials
SYNOPSIS
-
gcloud beta auth application-default login [--client-id-file=CLIENT_ID_FILE] [--no-launch-browser] [--scopes=SCOPES,[SCOPES,...]] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Note: Consider using a service account and the complementary gcloud auth activate-service-account to authorize access to Google Cloud
Obtains user access credentials via a web flow and puts them in the well-known location for Application Default Credentials to use them as a proxy for a service account.
This command is useful when you are developing code that would normally use a service account but need to run the code in a local development environment where it's easier to provide user credentials. The credentials will apply to all API calls that make use of the Application Default Credentials client library. Moreover, the GOOGLE_APPLICATION_CREDENTIALS environment variable which is set depending on the code's environment cannot be set once this command is run. To manually set this variable, refer to instructions at developers.google.com/identity/protocols/application-default-credentials#calling
API enablement and quotas are managed by the master Application Default Credentials project. In the case of errors related to the API not being enabled or quota limitations, use the --client-id-file flag. You can create the client-id-file at console.cloud.google.com/apis/credentials
This command has no effect on the user account(s) set up by the gcloud auth login command.
Any credentials previously generated by gcloud auth application-default login will be overwritten.
FLAGS
-
- --client-id-file=CLIENT_ID_FILE
-
A file containing your own client id to use to login.
- --launch-browser
-
Launch a browser for authorization. If not enabled or DISPLAY variable is not
set, prints a URL to standard output to be copied. Enabled by default, use
--no-launch-browser to disable.
- --scopes=SCOPES,[SCOPES,...]
-
The names of the scopes to authorize for. By default
www.googleapis.com/auth/userinfo.email
www.googleapis.com/auth/cloud-platform scopes are used. The list of
possible scopes can be found at:
developers.google.com/identity/protocols/googlescopes
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
If you want your local application to temporarily use your own user credentials for API access, run:
- $ gcloud beta auth application-default login
If you'd like to login by passing in a file containing your own client id, run:
-
$ gcloud beta auth application-default login \
--client-id-file=clientid.json
NOTES
This command is currently in BETA and may change without notice. This variant is also available:
- $ gcloud auth application-default login