{"action":"closed","issue":{"url":"https://api.github.com/repos/danthareja/node-google-apps-script/issues/18","labels_url":"https://api.github.com/repos/danthareja/node-google-apps-script/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/danthareja/node-google-apps-script/issues/18/comments","events_url":"https://api.github.com/repos/danthareja/node-google-apps-script/issues/18/events","html_url":"https://github.com/danthareja/node-google-apps-script/issues/18","id":111526623,"number":18,"title":"Trouble authenticating with client_secret.json","user":{"login":"thinkle","id":572507,"avatar_url":"https://avatars.githubusercontent.com/u/572507?v=3","gravatar_id":"","url":"https://api.github.com/users/thinkle","html_url":"https://github.com/thinkle","followers_url":"https://api.github.com/users/thinkle/followers","following_url":"https://api.github.com/users/thinkle/following{/other_user}","gists_url":"https://api.github.com/users/thinkle/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkle/subscriptions","organizations_url":"https://api.github.com/users/thinkle/orgs","repos_url":"https://api.github.com/users/thinkle/repos","events_url":"https://api.github.com/users/thinkle/events{/privacy}","received_events_url":"https://api.github.com/users/thinkle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-15T01:27:21Z","updated_at":"2015-10-31T22:42:54Z","closed_at":"2015-10-31T22:42:53Z","body":"I'm having trouble successfully authenticating.\r\n\r\nMy first problem I think is that I'd set the project type to web application and therefore my JSON file had no redirect URL:\r\n\r\nHere's the error output there:\r\n$ gaps init /home/tom/client_secret.json \r\n\r\n/usr/local/lib/node_modules/node-google-apps-script/lib/commands/init.js:34\r\n    auth.redirect_uri = credentials.web.redirect_uris[0];\r\n                                                     ^\r\nTypeError: Cannot read property '0' of undefined\r\n    at /usr/local/lib/node_modules/node-google-apps-script/lib/commands/init.js:34:54\r\n    at fs.js:268:14\r\n    at Object.oncomplete (fs.js:107:15)\r\n\r\nA little detective work shows that my JSON file in fact had no redirect_utis, so that makes sense.\r\n\r\nI then discovered if I downloaded a key for an \"Other\" application I got a key with a localhost redirect value, which seems like the right thing. However, this time I get a less helpful error from gaps:\r\n\r\n$ gaps init /home/tom/Downloads/otherother.json \r\nError running init command Path did not include correct credentials. Please check that you downloaded the right JSON credentials.\r\n\r\nAny help would be appreciated. I'd also suggest adding clarity in the docs about what kind of project to create in the google developer console."}}