How to get application_default_credentials.json file?

6,598 views
Skip to first unread message

Kiran Upadhya

unread,
Jul 18, 2018, 8:50:36 AM7/18/18
to Google Cloud Developers
I'm developing an application locally(python), I want to list the details of all the projects & their instances.

In order to perform this, I have generated `application_default_credentials.json` file by executing `gcloud auth application-default login` command, by using this file I can list all of my projects & their instances. But 

1. Is there any alternate way to generate this `application_default_credentials.json` file? If YES can you please show me one example for the same?
2. Instead of this file Is there any keys (like secret_id/secret_token..) to get details of all projects & their resources?
3. The file `application_default_credentials.json` has client_id, client_secret & refresh_token. Is it possible to generate these keys in `API's & Services` section in GCP?

(I have 3 projects & each project has 3 instances, I just wanted to collect details of all the projects & their instances locally)


Thank You
Kiran Upadhya

George (Cloud Platform Support)

unread,
Jul 18, 2018, 3:32:11 PM7/18/18
to Google Cloud Developers
Credentials to use them as a proxy for a service account. This allows you to connect to your app, not all projects together and their resources. More details may be read on the "gcloud auth application-default login" online documentation page
You can create the client-id-file at https://console.cloud.google.com/apis/credentials. This file should contain the keys you mention, and generally whatever credentials needed to connect as a proxy to a service account. 
Reply all
Reply to author
Forward
0 new messages