将用户名和密码返回到登录表单 grails spring security [英] Return username and password to login form grails spring security
问题描述
当用户身份验证失败时,我希望将用户名和密码返回到表单.我正在使用带有 Grails 和 Spring Security LDAP 的 spring 安全核心插件.我已经搜索了一段时间并想出了 zip.有什么想法吗?
When a user fails authentication, I want the username and password to be returned to the form. I'm using the spring security core plugin with Grails and Spring Security LDAP. I've searched around for a while and have come up with zip. Any ideas?
推荐答案
来自 UsernamePasswordAuthenticationFilter
javadoc:
From UsernamePasswordAuthenticationFilter
javadoc:
如果您想保留用户名,请将其缓存在自定义的 AuthenticationFailureHandler 中
If you want to retain the username, cache it in a customized AuthenticationFailureHandler
至于密码,没有必要缓存它,因为出于安全原因,它不能放回表单密码字段.
As for password there is no point to cache it, because it cannot be put back to form password field for security reasons.
这篇关于将用户名和密码返回到登录表单 grails spring security的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!