我正在使用Spring的Spring安全性,并且我使用URL(/logout)作为我的注销方法的端点.但在调用此方法后,它将我重定向到(/login?logout),我知道这是春天logOutSuccessUrl.我想摆脱重定向.这是我的代码:
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/login").permitAll()
.anyRequest().fullyAuthenticated()
.and().requiresChannel().anyRequest().requiresSecure()
.and().httpBasic().disable().logout()
.disable()
// .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler(HttpStatus.OK))
.csrf().disable();
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用HttpStatusReturningLogoutSuccessHandler但它没有用,甚至设置logoutSuccessUrl()也没有改变任何东西.
你知道我怎么能禁用这个重定向?