bsphere / node-gapitoken

Node.js Google API service account authorization
51 stars 19 forks source link

Token undefined #3

Closed m3talsmith closed 11 years ago

m3talsmith commented 11 years ago

I'm struggling to get a token from your library. I originally started out using the node-gcs library, but I was getting a 'Not Authorized' error back from Google. So I dove into implementing this first to understand it a bit.

Here's my gist

What happens is that I don't get an error and my token is undefined. I'm trying to deliver a cli today if possible. Please get back to me as you can. I'll be digging through your library in the meanwhile.

bsphere commented 11 years ago

use scope https://www.googleapis.com/auth/devstorage.full_control

see https://developers.google.com/storage/docs/authentication for all possible scope options

On Wed, Jul 3, 2013 at 4:06 PM, Michael Christenson II < notifications@github.com> wrote:

I'm struggling to get a token from your library. I originally started out using the node-gcs library, but I was getting a 'Not Authorized' error back from Google. So I dove into implementing this first to understand it a bit.

Here's my gist https://gist.github.com/m3talsmith/5917685

What happens is that I don't get an error and my token is undefined. I'm trying to deliver a cli today if possible. Please get back to me as you can. I'll be digging through your library in the meanwhile.

— Reply to this email directly or view it on GitHubhttps://github.com/bsphere/node-gapitoken/issues/3 .

m3talsmith commented 11 years ago

Perfect! Thank you. I think that should be a recommendation in your README for node-gcs. It's really not apparent what should be in there and it's difficult to dig through Google's API docs when you don't know what to look for.

mehtryx commented 11 years ago

To be fair, it is hard to recommend. Each api has different options, for instance in my use case I want analytics data and based on the analytics portion of the API for what I want the scope would be: https://www.googleapis.com/auth/analytics.readonly'

As painful as the google docs are, you have to really select scope to match needs, not something a library like this should dictate.

bsphere commented 11 years ago

I added a link to that Google doc to https://github.com/bsphere/node-gcs README

m3talsmith commented 11 years ago

+1 @bsphere Thanks!