AuthenticationManager에서 인증을 하고 만들어진 Authentication 객체가 있다.

Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
Object principal = authentication.getPrincipal();

이렇게 꺼낼 수 있었었다. 언제 들어 갔을까?

크게 두가지 필터가 넣어 준다.

UsernamePasswordAuthenticationFilter

SecurityContextPersistenceFilter

디버거로 확인을 해보자.