ExeptionTranslationFilter가 FilterCahin.doFilter(request, response)를 호출함
- 인증이 안되었을때
- AuthenticationException을 발생시키고 인증 로직을 시작함
- SecurityContextHolder는 비워짐
- 인증이 성공된다면 원래의 요청이 재사용되도록 HttpServletRequest가 저장됨
- AuthenticatinoEntryPoint는 사용자로부터 자격증명을 요청할때 사용됨. 예를 들어 페이지로 로그인페이지로 리다이렉트시키거나 WWW-Authenticate header를 보냄
- 반면 AccessDeniedException이 발생한다면 접근이 거부된것임으로 접근 거부를 처리하기 위해 AccessDeniedHandler가 호출됨
- SecurityContextHolder는 비워짐
- AuthenticationException을 발생시키고 인증 로직을 시작함
만약 어플리케이션이 AccessDeniedException이나
AuthenticationException을 던지지 않는다면 ExceptionTanslationFilter는 아무것도 하지 않음
Architecture :: Spring Security
The Security Filters are inserted into the FilterChainProxy with the SecurityFilterChain API. Those filters can be used for a number of different purposes, like authentication, authorization, exploit protection, and more. The filters are executed in a spec
docs.spring.io
'2024' 카테고리의 다른 글
[노마더 코드] 7.0.2 마이그레이션 (0) | 2024.12.09 |
---|---|
[Java] 람다 - 함수형 인터페이스 (0) | 2024.01.24 |
[Spring-Security] 아키텍처 - 필터 (0) | 2024.01.22 |
[JWT] 사전 지식 - HMAC, RSA, SHA256, HS256, RS256 (0) | 2024.01.19 |
[Security] CIA (0) | 2024.01.17 |