Another way of disabling the auto-security configuration is to surpass it with our own custom configuration. Spring Security is a highly customizable framework and provides a fine-grained access mechanism based on URL and role.
To substitute auto-configuration with custom configuration, we need to specify the configuration class, as in the following snippet:
@Configuration@EnableWebSecurity@ComponentScan("com.nilangpatel.blogpress")public class WebSecurityConfig extends WebSecurityConfigurerAdapter { …..}
The WebSecurityConfig custom configuration class extends the WebSecurityConfigurerAdapter abstract class. This abstract class has certain extension points (in the form of abstract methods for which you can ...