【发布时间】:2015-10-02 08:43:04
【问题描述】:
我怎样才能完全退出?我的 xml 文件中有:
<security:logout logout-url="/logoutMe" />
当我输入 /logoutMe 网址时,我没有注销 - 在我的控制器上我添加了:
SecurityContextHolder.getContext().getAuthentication().getName()
并将名称添加到ModelAndView并显示在我的页面上,仍然有我的用户名,而不是像之前登录的anonymousUser。
如何完全退出? 我还尝试使用以下方法创建自己的 LogoutSuccessHandler 实现:
SecurityContextHolder.clearContext();
但是..它似乎不起作用
【问题讨论】: