- NAME
-
- gcloud auth - manage oauth2 credentials for the Google Cloud SDK
- SYNOPSIS
-
-
gcloud authGROUP|COMMAND[ GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
The gcloud auth command group lets you grant and revoke authorization to Cloud
SDK (gcloud) to access Google Cloud Platform. Typically, when scripting Cloud
SDK tools for use on multiple machines, using
gcloud auth activate-service-accountis recommended.For more information on authorization and credential types, see: https://cloud.google.com/sdk/docs/authorizing.
While running
gcloud authcommands, the--accountflag can be specified to any command to use that account without activation. - GCLOUD WIDE FLAGS
-
These flags are available to all commands: --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account,
--log-http, --project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run
$ gcloud helpfor details. - GROUPS
-
is one of the following:GROUPapplication-default- Manage your active Application Default Credentials.
- COMMANDS
-
is one of the following:COMMANDactivate-service-account- Authorize access to Google Cloud Platform with a service account.
configure-docker-
Register
gcloudas a Docker credential helper. list- Lists credentialed accounts.
login- Authorize gcloud to access the Cloud Platform with Google user credentials.
print-access-token- Print an access token for the specified account.
print-identity-token- Print an identity token for the specified account.
revoke- Revoke access credentials for an account.
- EXAMPLES
-
To authenticate a user account with gcloud and minimal user output, run:
$ gcloud auth login --brief
To list all credentialed accounts and identify the current active account, run:
$ gcloud auth list
To revoke credentials for a user account (like logging out), run:
$ gcloud auth revoke test@gmail.com
- NOTES
-
These variants are also available:
$ gcloud alpha auth $ gcloud beta auth
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 2020-02-04.


