스프링 시큐리티

Ch02. 스프링 시큐리티 주요 아키텍처 이해 - 인증 개념 이해(Authentication)

webmaster 2022. 1. 16. 13:56
728x90

당신이 누구인지 증명하는 것

  • 사용자의 인증 정보를 저장하는 토큰 개념
  • 인증 id와 담고 인증 검증을 위해 전달되어사용된다
  • 인증 후 최종 인증 결과 (user 객체, 권한 정보)를 SecurityContext에 저장되어 전역적으로 참조가 가능하다
    • Authentication authentication = SecurityContexHolder.getContext(). getAuthentication()
  • 구조
    1. principal : 사용자 아이디 혹은 User 객체를 저장
    2. credentials : 사용자 비밀번호
    3. authorities : 인증된 사용자의 권한 목록
    4. details : 인증 부가 정보
    5. Authenticated : 인증 여부
  • 동작과정

    • AuthenticationManager가  인증처리를 한다.
    • 인증이 완료된 Authentication은 SecuritContext에 담겨 전역적으로 사용할 수 있다.
728x90