只是遵循了这个tutorial的自定义登录表单,但是当我提交其未进行身份验证但重定向回首页时。
这是配置
grails.plugin.springsecurity.auth.loginFormUrl = '/'
grails.plugins.springsecurity.successHandler.defaultTargetUrl = '/dashboard/'
grails.plugin.springsecurity.failureHandler.defaultFailureUrl = '/'
并发送请求到
http://localhost:8080/j_spring_security_check
状态码是302,响应头的位置是http://localhost:8080/
此外,具有默认ui的正常/ login / auth可以正常工作。
我是新来的,同时也需要安全。我想念什么吗? :|
版本:spring 3.0.4
grails 3.1.4
谢谢
最佳答案
只是阅读v3中的更改,正在查看旧的教程。为了节省别人的时间
/j_spring_security_check (the apf.filterProcessesUrl config setting) changed to /login/authenticate
/j_username (the apf.usernameParameter and switchUser.usernameParameter config settings) changed to username
/j_password (the apf.passwordParameter config setting) changed to password
/j_spring_security_logout (the logout.filterProcessesUrl config setting) changed to /logoff
In Spring Security 4 the value is actually /logout, but that conflicts with the standard LogoutController url, so the plugin uses /logoff instead
_spring_security_remember_me (the rememberMe.parameter config setting) changed to remember-me
/j_spring_security_switch_user (the switchUser.switchUserUrl config setting) changed to /login/impersonate
/j_spring_security_exit_user (the switchUser.exitUserUrl config setting) changed to /logout/impersonate
关于grails - 在Grails Spring Security Core插件中提交自定义登录表单时出现错误302,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36750050/