스프링 시큐리티 최신버전 코드 있을까요?
이게 답변이 될 수 있을지 모르겠는데요.. 저도 공부하면서 뭔가 틀려서 여러 삽질을 통해서 코드 변경해가면서 하고 있어서 @Configuration @EnableWebSecurity @RequiredArgsConstructor public class WebSecurity { private final UserService userService; private final BCryptPasswordEncoder bCryptPasswordEncoder; private final Environment env; private final AuthenticationConfiguration authenticationConfiguration; @Bean public WebSecurityCustomizer webSecurityCustomizer() { return (web) -> web.ignoring().requestMatchers(PathRequest.toStaticResources().atCommonLocations()); } @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.csrf().disable() .authorizeRequests() .antMatchers("/actuator/**").permitAll(); http.csrf().disable() .authorizeRequests().antMatchers("/**") .hasIpAddress("192.168.0.7") .and() .addFilter(getAuthenticationFilter(authenticationConfiguration)) .headers().frameOptions().disable(); return http.build(); } private AuthenticationFilter getAuthenticationFilter(AuthenticationConfiguration authenticationConfiguration) throws Exception { AuthenticationFilter authenticationFilter = new AuthenticationFilter(authenticationManager(authenticationConfiguration), userService, env); return authenticationFilter; } @Bean AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception { return authenticationConfiguration.getAuthenticationManager(); } }