简体   繁体   中英

The type WebSecurityConfigurerAdapter is deprecated

I'm working on a project and my problem is the WebSecurityConfigurerAdapter. It's doesn't work. It's say "The type WebSecurityConfigurerAdapter is deprecated" do you know why? Can you help me please? I don't know what to do

The WebSecurityConfigurerAdapter become deprecated in the version 5.7.0-M2 of Spring Security.

For more details you can read the blog posted by Spring io here ! .

WebSecurityConfigAdapter is now deprecated you can use this one

@Configuration public class SecurityConfiguration {

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http
        .authorizeHttpRequests((authz) -> authz
            .anyRequest().authenticated()
        )
        .httpBasic();
    return http.build();
}

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM