1.. 스프링 시큐리티 연동
2. 스프링 시큐리티 기본 설정(URL)
3. 스프링 시큐리티 : JPA 연동
4. 스프링 시큐리티 폼 설정
1. SecurityContextHolder와 Authentication
2. AuthenticationManager와 Authentication
3. ThreadLocal
4. Authentication과 SecurityContextHolder
Authentication은 객체를 리턴한다. Principal(User), Credentials, GrantedAuthorities를 리턴함.
AuthenticationManager를 통해 인증을 마친 ‘Authentication’은 폼 인증을 처리하는 시큐리티 필터인
‘UsernamePasswordAuthenticationFilter’은 Authentication 객체를
‘SecurityContextHolder’에 넣어주는 역할을 함.
SecurityContextHolder.getContext().setAuthentication(authentication).
다시, 여러 요청에서 Authentication을 공유할 수 있는 공유 필터
‘SecurityContextPersistenceFilter’는 HTTP Session에 캐시(기본전략)하에
‘SecurityContext’를 공유하며 ‘**SecurityContextRepository’**를
교체 해 세션을 HTTP Session이 아닌 다른 곳에 저장하는 것도 가능함.