Spring Security?

보안 용어

인증 아키텍처

  1. 사용자가 form을 통해 로그인 정보를 입력하고 인증 요청을 보냄
  2. AuthenticationFilter가 HttpServletRequest 에서 사용자가 보낸 ID, PW 인터셉트
    1. 안전을 위해 유효성 검사
    2. HttpServletRequest에서 가져온 ID, PW를 진짜 인증을 담당할 AuthenticationManager 인터페이스에게 인증용 객체로 만들어줘서 위임
  3. AuthenticationFilter에게 인증용 객체를 전달받는다.
  4. 실제 인증을 할 AuthenticationProvider에게 Authentication객체를 다시 전달한다.
  5. DB에서 사용자 인증 정보를 가져올 UserDetailsService 객체에게 사용자 아이디를 넘겨주고 DB에서 인증에 사용할 사용자 정보를 UserDetails라는 객체로 전달 받는다.