Spring security - Disable logout redirect

后端 未结 7 1811
北恋
北恋 2021-01-17 09:59

I\'m using spring security with REST, and I\'m using the URL (/logout) as an endpoint for my logout method. But after calling this method, it redirect me to (

7条回答
  •  爱一瞬间的悲伤
    2021-01-17 10:31

    for logoutSuccessXXX() action, do not forget to add permitAll() since the cookie is cleared after the logout() method is called. So my sample solution is:

             http
                ......
                .and()
                    .logout()
                        .logoutUrl("/logout")
                        .logoutSuccessUrl("/logoutSuccess")
                        **.permitAll()**
    

提交回复
热议问题