
Spring Security - ArcheTecher_DelegatingFilterProxy FilterChainProxy FilterChainProxy 는 어떻게 요청을 처리할수 있는가 ? ServletFilter 요청을 보내면 요청을 서블릿 컨테이너가 받게 된다. 서블릿기반 애플리케이션 이기 때문이다. 서블릿 컨테이너는 서블릿 스펙을 지원한다. 서블릿 스펙에는 Filter라는 개념이 존재한다. 어떤 요청의 전후 처리를 할수 있는 Interceptor같은 개념이다. https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/Filter.html 이러한 Filter의 구현체중 하나인 DelegatingFilterProxy 가 존재한다. Delet..

Spring Security - 아키텍쳐 Filter FilterChainProxy Spring Securty 가 제공하는 Filter와 FilterChainProxy Spring Security가 제공하는 Filter들 WebAsyncManagerIntergrationFilter SecurityContextPersistenceFilter HeaderWriterFilter CsrfFilter LogoutFilter UsernamePasswordAuthenticationFilter DefaultLoginPageGeneratingFilter DefaultLogoutPageGeneratingFilter BasicAuthenticationFilter RequestCacheAwareFilter SecurityCo..

Spring Security - ArcheTecher_Authenticaition SecurityContextHolder AuthenticationManager가 인증을 마친뒤 리턴받은 Authentication 객체가 언제 SecurityContextHolder로 저장되는지 살펴보자. 크게 두가지 필터가 사용된다. UsernamePasswordAuthenticationFilter SecurityContextPersistenceFilter SecurityContextHolder 인증이 되어있다면 다시 인증을 진행하는것이 아니다. SecurityContextHolder가 인증된 사용자 임을 알고있다. 동일한 Authentication객체가 유지된다. SecurityContextPersistenceFilte..

Spring Security - ArcheTecher_ThreadLocal java.lang 패키지에서 제공하는 Thread Scope Variable 쓰레드 수준의 데이터 저장소이다. SecurityContextHolder의 기본 전략이다. 같은 쓰레드 내에서만 공유 따라서 같은 쓰레드라면 해당 데이터를 메서드 매개변수로 사용하지않아도 데이터를 전달할 수 있다. Context 생성 ThreadLocal을 사용해서 한 쓰레드내에서 Account객체를 공유 할 수 있는 Context를 구현한다. Account 객체를 ThreadLocal에 저장하고, 가져오는 로직만 존재하는 매우 간단한 클래스이다. Context 활용 SampleService의 dashboard() 메서드 수정하기 dashboard() 메..