sintaxi / dbox

NodeJS SDK for Dropbox API (THIS LIBRARY IS OBSOLETE!!)
514 stars 91 forks source link

Authentication failed #58

Closed navaru closed 11 years ago

navaru commented 11 years ago

I try to run the tests and I get:

prompt: please authorize application at the following url and enter when done https://www.dropbox.com/1/oauth/authorize?oauth_token=undefined:

Same thing when trying to authorize using the example from the doc.

jstroem commented 11 years ago

Have you created a test/config/app.json file with your own app info before running the tests?

navaru commented 11 years ago

Yes, I've created the 'test/config/app.json' with the dropbox app credentials

jstroem commented 11 years ago

Check the pull request its fixed in there

navaru commented 11 years ago

@lindstroem I've cloned your repo (test branch), added the config files and:

 ▸ npm test               

> dbox@0.5.6 test /private/tmp/node-dbox
> ./node_modules/.bin/mocha -t 30000 test/all.js

  prompt: please authorize application at the following url and enter when done
https://www.dropbox.com/1/oauth/authorize?oauth_token=undefined:

App Type: App folder (so sandbox applies). The Dropbox App status is Development, could this be' affecting it? (my guess is not)

jstroem commented 11 years ago

you added only one config file right? you should only add app.json the other file is created by the app it self first time.

navaru commented 11 years ago

Yap, only the app.json, tho' I've created the other file to be empty, older version were trowing errors, but tried with and without that file and same result.

Could this be because of the key/secret?

I've made a test app, here are the credentials, for me its not working: { "app_key": "vburjyjkmufv2tw", "app_secret": "yqeywk22gcz3a28", "root": "sandbox" }

jstroem commented 11 years ago

I've just tried again its working. Try again:

> git clone git://github.com/lindstroem/node-dbox.git dbox-test
>  cd dbox-test
>  git branch test
>  git checkout test
>  git pull origin test
>  npm install

Next create /test/config/app.json with:

{ 
    "app_key": "vburjyjkmufv2tw",
    "app_secret": "yqeywk22gcz3a28",
    "root": "sandbox"
}

then run npm test

navaru commented 11 years ago

I still can't get it to work, but if it works for you then it means I have something wrong on my machine ... this could be closed.

I'll try to see why for me is not working, thank you for your help :)

On Wed, Jan 16, 2013 at 8:02 PM, lindstroem notifications@github.comwrote:

I've just tried again its working. Try again: git clone git://github.com/lindstroem/node-dbox.git node-test cd node-test git branch test git checkout test git pull origin test npm install

Next create /test/config/app.json with: { "app_key": "vburjyjkmufv2tw", "app_secret": "yqeywk22gcz3a28", "root": "sandbox" }

then run npm test

— Reply to this email directly or view it on GitHubhttps://github.com/sintaxi/node-dbox/issues/58#issuecomment-12331482.

jstroem commented 11 years ago

you could try to console.log the results you get from the token getter. Just add console.log(stataus,request_token); after app.requesttoken(function(status, request_token){.

and then paste the result. this should show why its failing

navaru commented 11 years ago

The problem was with node itself, not with the library, I was using v0.9.6 on my machine, rolled back to v0.8.17 and it works great.

With v0.9.6 I get this error: [Error: Hostname/IP doesn't match certificate's altnames] in requesttoken(..), it seems to do something with the TLS implementation.

Thank you for your help :)

jstroem commented 11 years ago

np. Can you close this?