Spring Security - 05 原生的退出登录

文章目录

  • 环境
  • 项目结构
  • 测试
  • 参考

环境

操作系统:

Windows 10 x64

集成开发环境:

Spring Tool Suite 4 
Version: 4.12.1.RELEASE
Build Id: 202110260750

浏览器(客户端):

Google Chrome
版本 97.0.4692.71(正式版本) (64 位)

项目结构

参考:Spring Security - 04 使用表单登录认证方式

测试

如果每次测试之前,都要先清除过去一小时的浏览数据,那实在是太麻烦了!

其实,我们可以访问 http://localhost:8080/logout 退出登录,退出登录成功之后,Spring Security 将我们重定向至 http://localhost:8080/login?logout 页面:

Spring Security - 05 原生的退出登录_第1张图片

参考

Spring Security > Servlet Applications > Authentication > Logout

你可能感兴趣的:(Spring,Security,spring,java,后端,spring,security,退出登录)