Spring Security Reference
The authenticator is also responsible for retrieving any required user attributes. This is because the permissions on the attributes may depend on the type of authentication being used. For example, if binding as the user, it may be necessary to read them
docs.spring.io
SecurityContextHolder
- 가장 기본적인 객체, SecurityContext 제공, 기본적으로 ThreadLocal을 사용한다.
SecurityContext
- Authentication 제공
Authentication
- Principal과 GrantAuthority를 제공
Principal
- "누구"에 해당하는 정보
- UserDetailsService에서 반환하는 객체 - UserDetails 타입
GrantAuthority
- "ROLE_USER", "ROLE_ADMIN"등 Principal이 가지고 있는 "권한"을 나타낸다
- 인증 이후, 인가 및 권한 확인할 때 이 정보를 조회한다
UserDetails
- 어플리케이션이 가지고 있는 유저 정보와 스프링 시큐리티가 사용하는 Authentication 객체 사이의 어댑터
- It represents a principal, but in an extensible and application-specific way. Think of UserDetails as the adapter between your own user database and what Spring Security needs inside the SecurityContextHolder
UserDetailsService
- 유저 정보를 UserDetails 타입으로 가져오는 DAO (Data Access Object) 인터페이스
'스터디-Spring' 카테고리의 다른 글
[스프링 시큐리티] ThreadLocal (0) | 2022.01.10 |
---|---|
[스프링 시큐리티] AuthenticationManager와 Authentication (0) | 2022.01.10 |
[스프링 시큐리티] 스프링 시큐리티 테스트 - Form Login (0) | 2022.01.09 |
[스프링 시큐리티] 스프링 시큐리티 테스트 - RequestPostProcessor, Annotations (0) | 2022.01.09 |
[스프링 시큐리티] 스프링 시큐리티 커스터마이징 - PasswordEncoder (0) | 2022.01.08 |