I want to set SessionCreationPolicy.STATELESS
but sessionManagement()
is deprecated and marked for removal. How can I set it?
The deprecated method is below:
@Bean
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests((requests) -> requests.anyRequest().authenticated());
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
http.authenticationProvider(authenticationProvider());
return http.build();
}