gcloud alpha auth Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha auth - manage oauth2 credentials for the Google Cloud CLI
- SYNOPSIS
gcloud alpha authGROUP|COMMAND[GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Thegcloudauthcommand group lets you grant and revoke authorization to GoogleCloud CLI (gcloudCLI) toaccess Google Cloud. Typically, when scripting Google Cloud CLI tools for use onmultiple machines, usinggcloud authactivate-service-accountis recommended.For information about authorization and credential types, seeAuthorizing the gcloudCLI. For information about authorizing a service account, seeAuthorizingwith a service account.
After running
gcloud authcommands, you can run other commands with--account=toauthenticate the command with the credentials of the specified account. Forinformation aboutACCOUNT--accountand othergcloudCLI global flags, see thegcloud CLI overview.See
$gcloudtopic client-certificateto learn how to use Mutual TLS when usinggcloud. Mutual TLS can be used forcertificatebased access with gcloud.- EXAMPLES
- To authenticate a user account with
gcloudand minimal user output, run:gcloudauthlogin--briefTo list all credentialed accounts and identify the current active account, run:
gcloudauthlistTo 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 helpfor details. - GROUPS
is one of the following:GROUPapplication-default(ALPHA)Manage your active Application Default Credentials.enterprise-certificate-config(ALPHA)Manage enterprise certificate configurations.
- COMMANDS
is one of the following:COMMANDactivate-service-account(ALPHA)Authorize access to Google Cloud with a service account.configure-docker(ALPHA)Registergcloudas a Docker credential helper.list(ALPHA)Lists credentialed accounts.login(ALPHA)Authorize gcloud to access the Cloud Platform with Googleuser credentials.print-access-token(ALPHA)Print an access token for the specified account.print-identity-token(ALPHA)Print an identity token for the specified account.revoke(ALPHA)Revoke access credentials for an account.
- 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:
gcloudauthgcloudbetaauth
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.