Configuration Migrations
The subsequent sections pertain to alterations in configuring HttpSecurity, WebSecurity, and AuthenticationManager.
Adding @Configuration annotation to @Enable* annotations
In version 6.0, the annotations @EnableWebSecurity, @EnableMethodSecurity, @EnableGlobalMethodSecurity, and @EnableGlobalAuthentication no longer include @Configuration.
For instance, @EnableWebSecurity will be modified from:
@EnableWebSecurity
public class SecurityConfig {
// ...
} to:
@Configuration
@EnableWebSecurity
public class SecurityConfig {
// ...
} To adapt to this change, wherever you utilize these annotations, you might need to add @Configuration.
Using the new requestMatchers methods
In Spring Security 5.8, the methods antMatchers, mvcMatchers, and regexMatchers were deprecated in favor of the new requestMatchers methods.
The introduction of the new requestMatchers methods extended to authorizeHttpRequests...