How to manually log out a user with spring security?

后端 未结 9 1303
情话喂你
情话喂你 2020-11-29 21:06

Probably the answer is simple: How can I manually logout the currently logged in user in spring security? Is it sufficient to call:

SecurityContextHolder.get         


        
9条回答
  •  猫巷女王i
    2020-11-29 21:35

    To log out a user in a web application you can also redirect him to the logout page. The LogoutFilter is then doing all the work for you.

    The url of the logout page is set in the security configuration:

    
      ...
      
      ...
    
    

提交回复
热议问题