WebSecurityConfigurerAdapter has been deprecated in Spring Security 5.7 but the javadoc of the following classes still encourages its use:
HttpSecurity:
|
* public class FormLoginSecurityConfig extends WebSecurityConfigurerAdapter { |
|
* |
|
* @Override |
|
* protected void configure(HttpSecurity http) throws Exception { |
|
* http.authorizeRequests().antMatchers("/**").hasRole("USER").and().formLogin(); |
|
* } |
|
* |
|
* @Override |
|
* protected void configure(AuthenticationManagerBuilder auth) throws Exception { |
|
* auth.inMemoryAuthentication().withUser("user").password("password").roles("USER"); |
|
* } |
|
* } |
WebSecurityConfiguration:
|
* can be made to {@link WebSecurity} by extending {@link WebSecurityConfigurerAdapter} |
- and
WebSecurity:
|
* {@link WebSecurityConfigurer}, overriding {@link WebSecurityConfigurerAdapter} or |
WebSecurityConfigurerAdapterhas been deprecated in Spring Security 5.7 but the javadoc of the following classes still encourages its use:HttpSecurity:spring-security/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java
Lines 117 to 128 in 4caf53e
WebSecurityConfiguration:spring-security/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java
Line 57 in 4caf53e
WebSecurity:spring-security/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
Line 80 in 4caf53e