스프링 시큐리티

Ch03. 실전프로젝트(인증 프로세스 Form 인증 구현) - 인증 부가 기능(WebAuthenticationDetails, AuthenticationDetailsSource)

webmaster 2022. 1. 19. 11:10
728x90

  • WebAuthenticationDetails
    • 인증 과정 중 전달된 데이터를 저장
    • Authenticationdetails 속성에 저장
  • AuthenticationDetailsSource
    • WebAuthenticationDetails 객체를 생성
  • Authentication객체 안에 details라는 속성이 있고, 이는 WebAuthenticationDetails라는 클래스 객체가 저장되어 있다.
    • WebAuthenticationDetails 안에는 클라이언트에게 입력받은 여러 값들이 저장되어 있다.
    • WebAuthenticationDetails 같은 경우 AuthenticationDetailsSource가 생성해 준다.
  • form에 부가적으로 저장할 데이터 저장
    • secret_key이름으로 secret값을 hidden으로 전송
      해당 값은 Authentication객체에 details에 저장할 것이다.
  • Provider에서 해당 값이 없다면 Exception이 발생하도록 한다.
    • Provider에 Detail에 추가 저장한 데이터를 가지고 인증을 한다.
  • CustomWebAuthenticationDetails
    • Custom WebAuthenticationDetails
      인증 시 내가 추가적으로 저장할 데이터를 추가한 채 저장한다.
  • CustomAuthenticationDetailsSource
    • CustomAuthenticationDetailsSource
728x90