The problem that you might be facing is that detecting Rails CSRF fakes helps create some of your authentication, as the requests come in as an HTTP POST method.
The first line in your ApplicationController is probably something like this:
class ApplicationController < ActionController::Base protect_from_forgery [...]
Delete this line 'protect_from_forgery' and see if it helps your problem. If this turns out to be the case, go back and install it on a more limited basis (only relevant controllers see here: http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html )
There is a great example for getting Omniauth to work at http://www.communityguides.eu/articles/16 , and the full example code is https://github.com/markusproske/omniauth_pure . However, they have the following:
class ServicesController < ApplicationController before_filter :authenticate_user!, :except => [:create, :signin, :signup, :newaccount, :failure] protect_from_forgery :except => :create
You need some variation of both of these lines so that omniauth, facebook, and rails sessions work well together. If this does not work, post information about OmniAuth :: Builder from the /production.rb environment (with XXXed out details) and any other related code in the controller that you use for authentication, which will be useful for debugging it.
This might be easier when developing rails applications using facebook for debugging using http://tunnlr.com or another service (or just ssh tunnel http://blog.kenweiner.com/2007/09/reverse-ssh-tunnel- for-facebook.html ), which allows you to run the debugger on your local computer, is very useful for solving these problems.
source share