本文介绍了Redmine:422无效的表单真实性令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用插件在我的IDP和redmine之间启用SSO.目的是避免登录Redmine时重新输入用户名和密码. Redmine和IDP都连接到外部LDAP.问题是从我的IDP重定向回Redmine(输入用户名和密码后),出现此错误.

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版本:2.5.2,Ruby版本:1.9.3,Rails版本:3.2.19

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

推荐答案

Redmine 3.4.2

Some details for Redmine 3.4.2

如果收到错误错误422(无法验证CSRF令牌的真实性),你必须去控制器文件

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

/app/controller/aplication_controller.rb

/app/controller/aplication_controller.rb

并使用代码删除或注释字符串

and remove or comment string with code

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

然后添加代码

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) 

这篇关于Redmine:422无效的表单真实性令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 01:06