I am getting a error:
OmniAuth::Strategies::Facebook::NoAuthorizationCodeError (must pass either a
`code` parameter or a signed request (via `signed_request` parameter or a
`fbsr_XXX` cookie)):
Its not coming all the time. Its coming once in a while, notified by airbrake.
There are lot of links for this on google search but not able to find out a proper solution.. Anyone?
omniauth.rb under initializers directory:
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'], {:client_options => {:ssl => {:ca_path => "/etc/ssl/certs"}}, :scope => 'user_about_me,email,publish_actions,user_location,publish_stream,offline_access,user_interests,user_likes,user_hometown', :display => 'popup'}
OmniAuth.config.on_failure = Proc.new do |env|
#this will invoke the omniauth_failure action in SessionsController.
"SessionsController".constantize.action(:omniauth_failure).call(env)
end
end
PS: I am using facebook javascript sdk with facebook-omniauth
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…