[Spring] Spring Security 인증 처리

·
Framework/Spring
안녕하세요.오늘은 Spring Security의 인증(Authentication) 처리가 내부적으로 어떻게 동작하는지를 정리해보려고 합니다.특히 인증 흐름은 여러 컴포넌트가 위임 방식으로 협력하기 때문에, 어디서 무엇을 하는지 모르면 커스텀하기도 어렵습니다. Authentication 객체란Spring Security에서 "인증된 사용자"를 표현하는 핵심 인터페이스가 Authentication입니다.주요 필드는 다음과 같습니다.필드의미principal인증 주체 (보통 UserDetails)credentials자격 증명 (비밀번호, 토큰 등)authorities부여된 권한 목록authenticated인증 완료 여부 (true/false)details부가 정보 (요청 IP, 세션 ID 등)Authentic..