Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

401 Unauthorized #45

Open
simicic opened this issue Oct 28, 2011 · 10 comments
Open

401 Unauthorized #45

simicic opened this issue Oct 28, 2011 · 10 comments

Comments

@simicic
Copy link

simicic commented Oct 28, 2011

Hi!

I have a very basic issue using this gem and I haven't figure out yet what is actually wrong. Maybe someone had the same problem?

So, configuration is:
rails (2.3.11)
ruby-1.9.2-p290
oauth (0.4.5)
dropbox (1.3.0)
(...)

controller action fails at this line (yes, very first, APP_KEY and APP_SECRET are the values obtained at dropbox pages):

dropbox_session = Dropbox::Session.new(APP_KEY, APP_SECRET)

it results with:
401 Unauthorized

and application trace...
.../gems/oauth-0.4.5/lib/oauth/consumer.rb:219:in 'token_request'
.../gems/oauth-0.4.5/lib/oauth/consumer.rb:139:in 'get_request_token'
.../gems/dropbox-1.3.0/lib/dropbox/session.rb:70:in 'initialize'
.../app/controllers/files_controller.rb:94:in 'new'
.../app/controllers/files_controller.rb:94:in 'authorize'

when am trying to initialize session using dropbox_sdk.rb file things are working (but I prefer using gems)

what am I doing wrong? can someone give me a hint because I am running out of ideas!
Thanks a lot! ;)

@cfiorini
Copy link

cfiorini commented Nov 3, 2011

i figured out using this tonywok@10fc9d1

@crystalneth
Copy link
Contributor

Looks like this gem is completely broken right now... I had to switch to

gem 'dropbox', :git => 'git://github.com/tonywok/dropbox.git', :branch => 'v1'

for the time being (I'm in early stage development, so this is fine right now)

@jonthewayne
Copy link

I tried using the dropbox gem in IRB and got the same error:

ruby-1.8.7-p249 > require 'dropbox'
=> true
ruby-1.8.7-p249 > session = Dropbox::Session.new('hidden', 'hidden')
OAuth::Unauthorized: 401 Unauthorized
from /home/bandega/ruby/gems/gems/oauth-0.4.5/lib/oauth/consumer.rb:219:in token_request'
from /home/bandega/ruby/gems/gems/oauth-0.4.5/lib/oauth/consumer.rb:139:inget_request_token'
from /home/bandega/ruby/gems/gems/dropbox-1.3.0/lib/dropbox/session.rb:70:in initialize'
from (irb):3:innew'
from (irb):3

Any ideas what is up? I'm trying to connect to my own app, which is in Development status (app is on same account I'm saving to though, so that should be cool, right?)

@rmoriz
Copy link

rmoriz commented Nov 21, 2011

OAuth response.body is:

{"error": "You're using an older version of the Dropbox API with a new API key. Please use the latest version."}

@crystalneth
Copy link
Contributor

This is because of an update to the Dropbox API in v1.0. Personally I switched to the official Dropbox API.

@crystalneth
Copy link
Contributor

All new applications will be broken with this gem until the gem is fixed.

@artur79
Copy link

artur79 commented Jan 20, 2012

@Allix: you mean all the new applications set up via Dropbox site ? Which gem you use now ?
I have the same problem, but I've found it rather fails on oauth lib level, before even dropbox gem is used. Application trace is empty, but full trace starts with:

oauth (0.4.5) lib/oauth/consumer.rb:219:in token_request' oauth (0.4.5) lib/oauth/consumer.rb:139:inget_request_token'
oa-oauth (0.3.2) lib/omniauth/strategies/oauth.rb:31:in request_phase' oa-core (0.3.2) lib/omniauth/strategy.rb:58:inrequest_call'
oa-core (0.3.2) lib/omniauth/strategy.rb:41:in call!' oa-core (0.3.2) lib/omniauth/strategy.rb:30:incall'

When switching to Dropbox credentials set up some time ago, it works. Like old and new Dropbox app behave different.

@crystalneth
Copy link
Contributor

Yes. New applications are required to do things the new way. I switched to the official gem.

Sent from my iPhone

On Jan 20, 2012, at 12:53 AM, [email protected] wrote:

allix: you mean all the new applications set up via Dropbox site ? Which gem you use now ?


Reply to this email directly or view it on GitHub:
#45 (comment)

@artur79
Copy link

artur79 commented Jan 23, 2012

I see. Have you tried that gem https://github.com/futuresimple/dropbox-api, also mentioned here https://www.dropbox.com/developers/reference/sdk, looks promising

@crystalneth
Copy link
Contributor

Perfectly fine with the official one. See no need to switch.

Sent from my iPhone

On Jan 23, 2012, at 1:05 AM, [email protected] wrote:

I see. Have you tried that gem https://github.com/futuresimple/dropbox-api, also mentioned here https://www.dropbox.com/developers/reference/sdk, looks promising


Reply to this email directly or view it on GitHub:
#45 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants