views:

256

answers:

1

Anyone know what the correct syntax to get an auth_token from Vimeo using the recently updated vimeo gem (http://github.com/matthooks/vimeo) using oAuth?

I'm trying this:

def authorize
  base = Vimeo::Advanced::Base.new(VIMEO_API_KEY, VIMEO_SECRET)
  redirect_to base.web_login_link("delete")
end #end method

--- get redirected to vimeo, allow access, then get redirected to app with frob variable ---

def callback
  vimeo = Vimeo::Advanced::Auth.new(VIMEO_API_KEY, VIMEO_SECRET)
  auth_token = vimeo.get_token(params[:frob])
end

-- now I get the following error:

{"err"=>{"msg"=>"Missing required parameter", "code"=>"307", "expl"=>"A required parameter was missing: oauth_consumer_key"}, "stat"=>"fail", "generated_in"=>"0.0054"}

Anyone familiar with this gem or the correct syntax to get the auth_token for making authenticated calls in the future

A: 

Based on the documentation on authenticating as a website in the readme, it looks like you're missing a few steps. The github README should have the latest info, so I won't paste it here.

Are you trying to accomplish something other than the example given is showing you how to do?

Have you tried vendoring the code instead of using the gem? Perhaps recent updates weren't deployed as a gem yet, as it does look like OAuth is a new feature based on the github history.

phloopy
The example code in the README under "Authorization (as a website)" fails, I get a method not found on vimeo.request_token. matthook's branch says OAuth support coming soon and to refer to sirlantis's branch (http://github.com/sirlantis/vimeo), which in turn says the branch is defunct w/ the changes integrated into matthooks. The readme on sirlantis's branch has different examples under Vimeo::Advanced::Base and Vimeo::Advanced::Auth. I can get the auth url to vimeo, and get it to redirect to my call back, but when I try auth.get_token("frob") is when I get error on oauth_consumer_key
bwizzy
Note that base.web_login_link is not producing a URL that has oauth_consumer_key in the URL (not sure if that is necessary)
bwizzy
What I got out of the different branches is that sirlantis was working on OAuth support and matthook told people to look there. After it was working, it was integrated back into matthook's branch, but the comment not updated.I'll try playing with it tonight and see if I can get anything to work.
phloopy