I'm working on logging in a site via existing facebook
account. So I registered a facebook application and stored api and secret in development.rb
and production.rb
files. Then I used omniauth-facebook gem
+ devise gem
to implement this. It works perfect.
By the way, an user can login either by internal authentication (by devise) or by usig facebook account.
However there is a weird issue. It works perfect only if I login into facebook account in that I registered an application.
So I registered another facebook account that didn't have an application used in my Rails application and tried to login. It caused an error "An error occurred. Please try again later." ... "Could not authenticate you from Facebook-Account because "Csrf detected""
I tried to use 1.4.0 omniauth-facebook gem instead of 1.4.1 one but it also caused an error "must pass either a
codeparameter or a signed request (via
signed_requestparameter or a
fbsr_XXXcookie)
"
Gems
oauth2 (0.8.0)
omniauth (1.1.0)
omniauth-oauth2 (1.1.0)
omniauth-facebook (1.4.1)
warden (1.2.1)
devise (2.1.2)
Your ideas?