@Configuration @EnableWebSecurity @Slf4j
WebSecurityConfigurerAdapter deprecated and deleted in Spring boot 3.0
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
configure chance HttpSecurity http with SecurityBuilder builder in spring 3.0
@Override protected void configure(HttpSecurity http) throws Exception { log.trace("configure(HttpSecurity http)"); http.cors() .and() .csrf() .disable() .exceptionHandling() .authenticationEntryPoint(unauthorizedHandler) .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() .authorizeRequests() .antMatchers("/**") .permitAll() .anyRequest() .authenticated(); }
}