0

@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(); }

}

  • You should refer to this post https://stackoverflow.com/questions/74447778/spring-security-in-spring-boot-3 – Jilliss Feb 14 '23 at 09:43
  • Does this answer your question? [Use Keycloak Spring Adapter with Spring Boot 3](https://stackoverflow.com/questions/74571191/use-keycloak-spring-adapter-with-spring-boot-3) – ch4mp Mar 24 '23 at 21:47

0 Answers0