- NAME
-
- gcloud auth - manage oauth2 credentials for the Google Cloud CLI
- SYNOPSIS
-
-
gcloud auth
GROUP
|COMMAND
[GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
-
The
gcloud auth
command group lets you grant and revoke authorization to Google Cloud CLI (gcloud
CLI) to access Google Cloud. Typically, when scripting Google Cloud CLI tools for use on multiple machines, usinggcloud auth activate-service-account
is recommended.For information about authorization and credential types, see Authorizing the gcloud CLI. For information about authorizing a service account, see Authorizing with a service account.
After running
gcloud auth
commands, you can run other commands with--account
=
to authenticate the command with the credentials of the specified account. For information aboutACCOUNT
--account
and othergcloud
CLI global flags, see the gcloud CLI overview.See
$ gcloud topic client-certificate
to learn how to use Mutual TLS when using gcloud. Mutual TLS can be used for certificate based access with gcloud. - 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
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--help
.Run
$ gcloud help
for details. - GROUPS
-
is one of the following:GROUP
application-default
- Manage your active Application Default Credentials.
enterprise-certificate-config
- Manage enterprise certificate configurations.
- COMMANDS
-
is one of the following:COMMAND
activate-service-account
- Authorize access to Google Cloud with a service account.
configure-docker
-
Register
gcloud
as 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.
- 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 2024-02-06 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"last_modified": "Last updated 2024-02-06 UTC.",
"state": ""
}