Difference between revisions of "Gcloud auth list"

From wikieduonline
Jump to navigation Jump to search
 
(13 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
https://cloud.google.com/sdk/gcloud/reference/auth/list
 
https://cloud.google.com/sdk/gcloud/reference/auth/list
 
  [[gcloud auth]] list
 
  [[gcloud auth]] list
 +
 +
[[gcloud auth]] list
 +
                    Credentialed Accounts
 +
ACTIVE  ACCOUNT
 +
*      your_user@you_account.[[iam.gserviceaccount.com]]
 +
 +
To set the active account, run:
 +
    $ [[gcloud config set account]] `ACCOUNT`
 +
 +
[[gcloud auth]] list
 +
                    Credentialed Accounts
 +
ACTIVE  ACCOUNT
 +
        your_user@you_account.[[iam.gserviceaccount.com]]
 +
 +
 +
To set the active account, run:
 +
    $ [[gcloud config set account]] `ACCOUNT`
 +
 +
 +
=== List active account ===
 +
ACCOUNT=$(\
 +
  [[gcloud auth]] list \
 +
  --format="yaml" --filter="status=ACTIVE" \
 +
  --format="value(account)"\
 +
) && echo ${ACCOUNT}
 +
 +
 +
gcloud auth list
 +
 +
No credentialed accounts.
 +
 +
To login, run:
 +
  $ [[gcloud auth login]] `ACCOUNT`
  
 
== Related ==
 
== Related ==
 +
* <code>[[gcloud config list]]</code>
 
* <code>[[gcloud config set account]]</code>
 
* <code>[[gcloud config set account]]</code>
 
* <code>[[gcloud init]]</code>
 
* <code>[[gcloud init]]</code>
 +
* <code>[[GOOGLE_APPLICATION_CREDENTIALS]]</code>
 +
* <code>[[gcloud auth application-default login]]</code>
 +
* <code>[[gcloud auth login]]</code>
 +
* <code>[[gcloud iam service-accounts describe]]</code>
  
 
== See also ==
 
== See also ==
 
* {{gcloud auth}}
 
* {{gcloud auth}}
* {{gcloud}}
 
  
 
[[Category:GCP]]
 
[[Category:GCP]]

Latest revision as of 16:54, 7 December 2023

https://cloud.google.com/sdk/gcloud/reference/auth/list

gcloud auth list
gcloud auth list
                   Credentialed Accounts
ACTIVE  ACCOUNT
*       your_user@you_account.iam.gserviceaccount.com

To set the active account, run:
    $ gcloud config set account `ACCOUNT`
gcloud auth list
                   Credentialed Accounts
ACTIVE  ACCOUNT
        your_user@you_account.iam.gserviceaccount.com
*       [email protected]

To set the active account, run:
    $ gcloud config set account `ACCOUNT`


List active account[edit]

ACCOUNT=$(\
  gcloud auth list \
  --format="yaml" --filter="status=ACTIVE" \
  --format="value(account)"\
) && echo ${ACCOUNT}


gcloud auth list

No credentialed accounts.

To login, run:
  $ gcloud auth login `ACCOUNT`

Related[edit]

See also[edit]

Advertising: