grails - 在Grails Spring Security Core插件中提交自定义登录表单时出现错误302

标签 grails spring-security grails-plugin

只是遵循了这个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/

相关文章:

java - 为 Spring Security 设置 LDAP 查询超时

grails - 如果使用 grails asset-pipeline 插件,如何处理 css 中的图像位置?

grails - 是否可以创建一个扩展 Grails 中的抽象 Controller 的 Controller ?

grails - Grails/GORM 中的继承和约束问题

class - Grails新域实例返回null

spring - 如何配置Spring Boot和Spring Security同时支持表单登录和Google OAuth2登录

java - Spring Security - 使用请求主机名进行 token 身份验证

Grails Spring Security 最大并发 session

grails - 如何告诉 Grails 使用 Gradle 进行依赖项解析

json - 使用JSON View 生成JSON