Omar LO
Omar LO

Reputation: 11

How to disable default Spring security with Spring boot?

I use Spring boot 2 and Spring security but I can't disable the default security. This is my configuration class:

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter

Upvotes: 1

Views: 98

Answers (1)

Ortomala Lokni
Ortomala Lokni

Reputation: 62456

As said in the comments, you have to exclude the security auto configuration with:

@SpringBootApplication(exclude={SecurityAutoConfiguration.class})

Upvotes: 1

Related Questions