How do I bypass protect_from_forgery in Rails 3 for a Facebook canvas app?

I have a Rails 3 Facebook canvas app. When it loads up it gives me an invalid authenticity token error and displays the signed_request parameter that Facebook sends to my app. Is there a way to bypass the 'protect_from_forgery' for the signed_request from facebook?

Thanks!

Tim

Answers


Problem solved. I added

skip_before_filter :verify_authenticity_token, :only => [THE ACTION]

to the top of my controller.


You can also just remove protect_from_forgery from the application controller, if you only use the app as a canvas app.


Need Your Help

Accessing the index in Python for loops

python loops list

Does anyone know how to access the index itself for a list like this:

Insert * before underlined text in Word

regex ms-word replace

I have a page full of text like this (NOTE: the c. is underlined, but you can't underline text in markdown.)

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.