注销侦听器获取用户详细信息

时间:2014-06-27 13:10:03

标签: spring http

我有一个实现HttpSessionListener的LogoutListener,在sessionDestroyed方法中我想清除登录用户访问上下文。在这种方法中,我无法获取登录用户的详细信息以删除它。如何获得这一点的任何帮助都将是辉煌的。感谢。

public class LogoutListener implements HttpSessionListener { 
.
.
.
public void sessionDestroyed(HttpSessionEvent event) {

我尝试使用以下内容来获取身份验证,但它返回null:

Authentication auth = SecurityContextHolder.getContext().getAuthentication();

0 个答案:

没有答案