{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1653","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1653/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1653/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1653/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1653","id":180218315,"number":1653,"title":"google-cloud-node does not work with Application Default Credentials","user":{"login":"jmdobry","id":1213510,"avatar_url":"https://avatars.githubusercontent.com/u/1213510?v=3","gravatar_id":"","url":"https://api.github.com/users/jmdobry","html_url":"https://github.com/jmdobry","followers_url":"https://api.github.com/users/jmdobry/followers","following_url":"https://api.github.com/users/jmdobry/following{/other_user}","gists_url":"https://api.github.com/users/jmdobry/gists{/gist_id}","starred_url":"https://api.github.com/users/jmdobry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmdobry/subscriptions","organizations_url":"https://api.github.com/users/jmdobry/orgs","repos_url":"https://api.github.com/users/jmdobry/repos","events_url":"https://api.github.com/users/jmdobry/events{/privacy}","received_events_url":"https://api.github.com/users/jmdobry/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/labels/auth","name":"auth","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-09-30T04:38:10Z","updated_at":"2016-09-30T17:21:14Z","closed_at":null,"body":"### Problem\r\n\r\nAfter running `gcloud beta auth application-default login` I should be able to use google-cloud-node to access Google Cloud Platform services, but I can't. I _must_ set the `GCLOUD_PROJECT` env var or explicitly pass a project ID to a client for google-cloud-node to work.\r\n\r\n### Steps to reproduce\r\n\r\n1. Install the Google Cloud SDK, git, Node.js and NPM\r\n1. Run `gcloud init`, you'll be prompted to set a default project\r\n1. Run `gcloud beta auth application-default login` and follow the OAuth 2.0 flow to login\r\n1. Clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git\r\n1. Run `cd nodejs-docs-samples/storage`\r\n1. Run `npm install`\r\n1. Run `node buckets.js list`\r\n\r\nObserve the error:\r\n\r\n```\r\nError: Sorry, we cannot connect to Google Cloud Services without a project ID. You may\r\nspecify one with an environment variable named \"GCLOUD_PROJECT\". See\r\nhttps://googlecloudplatform.github.io/google-cloud-node/#//docs/guides/authentication\r\nfor a detailed guide on creating an authenticated connection.\r\n```\r\n\r\n1. Modify `buckets.js` to explicitly pass in a project ID\r\n1. Run `node buckets.js list`\r\n1. It works\r\n1. Undo your changes to `buckets.js`\r\n1. Set the `GCLOUD_PROJECT` env var to your project ID\r\n1. Run `node buckets.js list`\r\n1. It works\r\n\r\n### Expected\r\n\r\n1. Open terminal\r\n1. Run `cd nodejs-docs-samples/storage`\r\n1. Run `gcloud beta auth application-default login`\r\n1. Run `node buckets.js list` (No env vars are set, code does not pass project ID to client)\r\n1. It works"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/comments/250802357","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1653#issuecomment-250802357","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1653","id":250802357,"user":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T17:21:14Z","updated_at":"2016-09-30T17:21:14Z","body":"Re: default vs active\r\n\r\n I think it's for supporting multiple configurations by using `gcloud config configurations` sub command. It should read the active config file.\r\n\r\nBut, the implementation can change, so how about to call `gcloud -q config list core/project --format=json` ?"}}
{"actor":{"display_login":"tmatsuo"}}