简体   繁体   English

vimeo ruby​​ gem oAuth的auth_token示例?

[英]vimeo ruby gem auth_token example for oAuth?

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? 任何人都知道使用oAuth使用最近更新的vimeo gem( http://github.com/matthooks/vimeo )从Vimeo获取auth_token的正确语法是什么?

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 --- ---重定向到vimeo,允许访问,然后使用frob变量重定向到应用程序-

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"} {“ err” => {“ msg” =>“缺少所需参数”,“代码” =>“ 307”,“ expl” =>“缺少所需参数:oauth_consumer_key”},“ stat” =>“失败“,” 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 熟悉此gem或使用正确语法以获取auth_token以便将来进行经过身份验证的调用的任何人

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. github自述文件应该具有最新信息,所以我不会在这里粘贴它。

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? 您是否尝试提供代码而不是使用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. 也许最近的更新尚未部署为gem,因为OAuth确实是基于github历史记录的新功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM