ExceptionTranslationFilter란
ExceptionTranslationFilter
FilterSecurityInterceptor
바로 위에 위치하며 FilterSecurityInterceptor
실행 중 발생할 수 있는 AuthenticationException
과 AccessDeniedException
의 처리를 담당하는 필터
AuthenticationException
는 인증 관련 예외이며 사용자를 로그인 페이지로 보냄
AccessDeniedException
는 AccessDecisionManager
에 의해 접근 거부가 발생했을 때 접근 거부 페이지를 보여주거나 사용자를 로그인 페이지로 보냄
doFilter()
AuthenticationException
과 AccessDeniedException
이 아니면 this.rethrow()
handleSpringSecurityException()
AuthenticationException
-> this.handleAuthenticationException()
AccessDeniedException
-> this.handleAccessDeniedException()
handleAuthenticationException()
- this.
sendStartAuthentication()
호출
handleAccessDeniedException()
- 익명 사용자 or remberMe 를 통해서 인증 된 사용자의 경우 this.
sendStartAuthentication()
호출
- 둘 다 아닌 경우 this.
accessDeniedHandler
호출
sendStartAuthentication()