https://github.com/hyena0608/springsecurity/commit/77d3abb054d814df8ac6892bcc8d53f87ba954d1
이전 시간에 스프링 시큐리티가 /login
주소 요청이 오면 로그인을 대신 진행시켜주었다.
로그인 진행이 완료 되면 Security Session
을 만들어 주는데
이 시큐리티가 가지고 있는 Session에 들어갈 수 있는 오브젝트는 Authentication
타입 객체이다.
Authentication
안에는 User 정보가 있어야 되는데
이 때 User 오브젝트 타입은 UserDetails
타입 객체 이다.
<aside> 🧙♂️ Security Session → Authentication 객체 → UserDetails 타입
즉, Security Session에 Authentication 객체를 꺼내면 UserDetails 타입을 받아 쓸 수 있다.
</aside>
이번 시간에는 UserDetails를 PrincipalDetails에 상속받아서 사용할 것이다.
PrincipalDetails에 상속 받아서 사용하면 나중에 활용하기 좋기 때문이다.
또한 실무에서 필요한 정보를 모두 담을 수가 없기에 CustomUserDetails가 필요한 것이다 !