我正在使用 rails 3.2.11 和 omniauth gem 来验证用户的 Facebook 帐户。
宝石文件
gem 'omniauth-facebook', '1.4.0'.
/config/initializers/omniauth.rb
require 'facebook'
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, "#{Facebook::APP_ID.to_s}", "#{Facebook::SECRET.to_s}" ,{:scope => "email, offline_access, manage_pages"}
end
路线.rb
match "/auth/:provider/callback" => "public_new_pages#auth_callback", :as => :callback
match "/auth/failure" => "public_new_pages#failure", :as => :failure
我想使用 Facebook 图形 API 访问大品牌 Facebook 页面的专辑图片。我不能一直得到。它适用于一些 Facebook 页面。无法找到正确的解决方案,为什么我收到如下错误并且我的页面崩溃了。
In browser I see Internal server error 500. and in console I see the error
below when I tried to create a big site called "BMW"
Started GET "/auth/facebook/callback" for 66.249.74.126 at 2013-03-17 01:10:45
**OmniAuth::Strategies::Facebook::NoAuthorizationCodeError
(must pass either a `code` parameter or a signed request**
(via `signed_request` parameter or a `fbsr_XXX` cookie)):
omniauth-facebook (1.4.0) lib/omniauth/strategies/facebook.rb:177:in
`with_authorization_code!'
有什么解决办法吗?
谢谢!