Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redmine: 422 invalid form authenticity token

I'm using this plugin to enable SSO between my IDP and redmine. Purpose is to avoid re entering username and password when login to the redmine. Both Redmine and the IDP connected to an external LDAP. Problem is after redirecting back to the redmine from my IDP (after entering username & password), It's giving this error.

Redmine version: 2.5.2, Ruby version: 1.9.3, Rails version: 3.2.19

error

like image 852
Chanuka Ranaba Avatar asked Sep 28 '22 16:09

Chanuka Ranaba


1 Answers

Some details for Redmine 3.4.2

If you get an error 422 (Can't verify CSRF token authenticity), you must go to controller file

/app/controller/aplication_controller.rb

and remove or comment string with code

render_error :status => 422, :message => "invalid form authenticity token."

then add code

redirect_back_or_default(home_path)

So, your code will be like this

# render_error :status => 422, :message => "invalid form authenticity token."
redirect_back_or_default(home_path) 
like image 57
Wild Black Boar Avatar answered Oct 05 '22 06:10

Wild Black Boar