This is my AppConfig file. How can I resolve ‘sessionManagement()’,’and()’,’csrf()’,’cors()’ is deprecated since version 6.1 and marked for removal?
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.cors()
.and()
.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER)
.and()
.exceptionHandling()
.authenticationEntryPoint(jwtAuthEntryPoint)
.and()
.addFilterBefore(new JwtAuthFilter(jwtProvider), UsernamePasswordAuthenticationFilter.class)
.authorizeRequests()
.antMatchers("/api/auth/**").authenticated()
.antMatchers(PERMIT_URL_ARRAY).permitAll()
.mvcMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.anyRequest().permitAll();
return http.build();
}
I want to fix this to Spring Security 6.x version
Please help me
New contributor
user25090342 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.