Aparentemente a partir da versão 5.7 o Spring descontinuou o uso do WebSecurityConfigurerAdapter, para encorajar uma configuração de segurança baseada em componentes. Então, o que era escrito assim:
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            .authorizeHttpRequests((authz) -> authz
                .anyRequest().authenticated()
            )
            .httpBasic(withDefaults());
    }
}Passa a ser recomendado assim, por exemplo:
@Configuration
public class SecurityConfiguration {
    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http
            .authorizeHttpRequests((authz) -> authz
                .anyRequest().authenticated()
            )
            .httpBasic(withDefaults());
        return http.build();
    }
}Para saber mais: https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter
 
            