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 (/login?logout
), I know this is the spring logOutSuccessUrl
. And I want to get rid of the redirection. This is my code:
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();
}
I tried to use HttpStatusReturningLogoutSuccessHandler
but it didn't work, and even setting logoutSuccessUrl()
doesn't change anything.
Do you know how can I disable this redirection?