Spring Security Structure

60jong·2023년 1월 31일
0

Spring

목록 보기
5/9

Spring Security Structure

HttpRequest -> AuthenticationFilter (UsrPwAthFilter)가 가로챔
-> request의 정보를 기반으로 미인증인 UsrPwAthToken 생성
-> ProviderManager(AuthenticationManager)에게 전달, 여기서 authenticate
-> AuthenticationProvider 들 중에 authentication을 지원하는 provider가
authenticate함.
-> 이를 UserDetilsService에서 loadUserByUsername 메서드를 통해 DB에서 조회 후
UserDetails 리턴

-> AuthenticationProvider는 UserDetails를 받아서 사용자 정보와 비교
-> 인증이 완료되면 Authentication 객체 반환
-> AuthenticationFilter는 인증된 Authentication 객체
-> SecurityContextHolder에 있는 SercurityContext에 Authentication객체를 저장

profile
울릉도에 별장 짓고 싶다

0개의 댓글