Search code examples
ruby-on-railsoauth-2.0csrf

Rails / Doorkeeper: Can't verify CSRF token authenticity


I'm using Rails 3.2 with Doorkeeper gem for providing OAuth 2 API for 3rd party. I keep getting this warning when using my REST API from outside of the app:

WARNING: Can't verify CSRF token authenticity

The client app successfully authenticated via OAuth2. Why do I get this warning, and how to implement this csrf properly for the external API?


Solution

  • Remove protect_from_forgery from your ApplicationController (or remove it for calls to the API).