gcloud auth

NAME
gcloud auth - manage oauth2 credentials for the Google Cloud CLI
SYNOPSIS
gcloud authGROUP |COMMAND[GCLOUD_WIDE_FLAG]
DESCRIPTION
Thegcloud auth command group lets you grant and revokeauthorization to Google Cloud CLI (gcloud CLI) to access Google Cloud.Typically, when scripting Google Cloud CLI tools for use on multiple machines,usinggcloudauth activate-service-account is recommended.

For information about authorization and credential types, seeAuthorizing the gcloudCLI. For information about authorizing a service account, seeAuthorizingwith a service account.

After runninggcloud auth commands, you can run other commands with--account=ACCOUNT toauthenticate the command with the credentials of the specified account. Forinformation about--account and othergcloud CLI global flags, see thegcloud CLI overview.

See$gcloudtopic client-certificate to learn how to use Mutual TLS when usinggcloud. Mutual TLS can be used forcertificatebased access with gcloud.

EXAMPLES
To authenticate a user account withgcloud and minimal user output, run:
gcloudauthlogin--brief

To list all credentialed accounts and identify the current active account, run:

gcloudauthlist

To revoke credentials for a user account (like logging out), run:

gcloudauthrevoketest@gmail.com
GCLOUD WIDE FLAGS
These flags are available to all commands:--help.

Run$gcloud help for details.

GROUPS
GROUP is one of the following:
application-default
Manage your active Application Default Credentials.
enterprise-certificate-config
Manage enterprise certificate configurations.
COMMANDS
COMMAND is one of the following:
activate-service-account
Authorize access to Google Cloud with a service account.
configure-docker
Registergcloud as a Dockercredential 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.
NOTES
These variants are also available:
gcloudalphaauth
gcloudbetaauth

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-08-26 UTC.