Estou utilizando o seguinte método na classe SecurityConfigurations:
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().authorizeHttpRequests()
.requestMatchers(HttpMethod.POST, "/login").permitAll()
.anyRequest().authenticated()
.and().build();
}
Porém ele se mantém deprecado, mesmo sendo o método corrigido, para facilitar na resposta abaixo seguem os alarmes indicados pela IDEA:
'csrf()' is deprecated and marked for removal
'sessionManagement()' is deprecated and marked for removal
'and()' is deprecated and marked for removal
'authorizeHttpRequests()' is deprecated and marked for removal
'and()' is deprecated and marked for removal
nota - Já verifiquei as importações e a classe está corretamente configurada com a anotação.