我正在尝试在 Rails 上实现一个两条腿的 OAuth 提供程序。
我按照这些说明安装消费者和提供者:
https://github.com/pelle/oauth-plugin
使用这些说明使消费者工作
这些指令实现用户登录
https://github.com/plataformatec/devise
并使用这些方法来测试连接
http://oauth.rubyforge.org/rdoc/classes/OAuth/Consumer.html
按照这些说明实施两条腿策略
但在消费者方面,我得到
Completed 500 Internal Server Error in 86ms
OAuth::Unauthorized (401 Unauthorized ):
oauth (0.4.7) lib/oauth/consumer.rb:216:in `token_request'
oauth (0.4.7) lib/oauth/consumer.rb:136:in `get_request_token'
...
在服务器端
Started POST "/oauth/request_token" for 127.0.0.1 at Sun Jan 06 22:02:08 -0300 2013
Processing by OauthController#request_token as */*
Rendered text template (0.0ms)
Filter chain halted as # <OAuth::Controllers::ApplicationControllerMethods::Filter:0x1111e0e80 @strategies=[:two_legged], @options={:interactive=>false, :strategies=>:two_legged}> rendered or redirected
Completed 401 Unauthorized in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)
这篇文章似乎指向了同样的问题
https://github.com/pelle/oauth-plugin/issues/106
我正在使用两条腿的实现来允许从我的原生 android 应用程序登录到我的 rails 应用程序。
这篇文章似乎与我的问题有关
Rails Oauth:无法获取 request_token,过滤器链停止
我不知道在哪里查看或如何在服务器端获取更详细的日志。
任何帮助将不胜感激。谢谢!