Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Archives
Today
Total
관리 메뉴

민쓰다이어리

[SpringBoot] SecurityFilterChain 본문

공부/스프링·부트

[SpringBoot] SecurityFilterChain

Leem 2023. 7. 12. 10:59

이제 더이상 SpringSecurity 에서 WebSecurityConfigureAdapter 를 사용하기 어려워짐

그래서 대안으로 SecurityFilterChain 을 사용했다

 

 

@Configuration
@EnableWebSecurity
@EnableMethodSecurity(prePostEnabled = true)
public class SecurityConfig{


	@Bean
    SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
      

        return http.build();
    }

 

 

@EnableWebSecurity ?

- 스프링 시큐리티의 웹 보안 기능을 담당하는 어노테이션이다

요청되는 모든 url이 이 어노테이션을 통해 제어받는다.

 

@EnableMethodSecurity ?

- 보안 기능

(prePostEnabled = true)

- 어노테이션의 사용여부를 결정한다