Skip to Content
Suffering builds character
아카이브18.스프링 시큐리티스프링 시큐리티5.부록필터8.Security Filter 목록 확인

8.Security Filter 목록 확인

등록된 시큐리티 필터들을 코드 레벨에서 확인 하기 위해서는 SecurityConfig.java에서 아래의 옵션을 사용하여 확인 가능

SecurityConfig.java
@EnableWebSecurity(debug=true) // debug=true로 변경 public class SecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { return http.build(); } }

INFO 레벨로 Console에 출력된 필터 목록 예시

2023-06-14T08:55:22.321-03:00 INFO 76975 --- [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [ org.springframework.security.web.session.DisableEncodeUrlFilter@404db674, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@50f097b5, org.springframework.security.web.context.SecurityContextHolderFilter@6fc6deb7, org.springframework.security.web.header.HeaderWriterFilter@6f76c2cc, org.springframework.security.web.csrf.CsrfFilter@c29fe36, org.springframework.security.web.authentication.logout.LogoutFilter@ef60710, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@7c2dfa2, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@4397a639, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@7add838c, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@5cc9d3d0, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7da39774, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@32b0876c, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3662bdff, org.springframework.security.web.access.ExceptionTranslationFilter@77681ce4, org.springframework.security.web.access.intercept.AuthorizationFilter@169268a7 ]
💡
Tip

FilterChain에 커스텀 필터 추가하기 

시큐리티에서 기본적으로 제공하는 필터 이외에도 개발자가 직접 작성한 커스텀 필터를 추가할 수도 있음

Last updated on