【发布时间】:2017-05-20 02:02:21
【问题描述】:
我们使用 Spring Security 4.0.x,我需要找到访问已注销用户名的方法。
我已经配置了LogoutSuccessHandler:
<logout logout-url="/logout" success-handler-ref="logoutSuccessHandler" />
我在方法签名中看到了authentication 对象:
onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
不幸的是,authentication 对象是空的。
我看到LogoutHandler (SecurityContextLogoutHandler) 在logoutSuccessHandler 之前清除了身份验证,但我找不到通过<logout .. 配置配置LogoutHandler 的方法。
如何在 Spring Security 中访问已注销的用户名?
【问题讨论】:
标签: spring-security spring-security4