[Spring Security] 내부구조
- 📚 Spring/Spring-Security
- 2022. 2. 9. 13:10
| Spring Security 내부구조
SecurityContextHolder -> SecurityContext -> Authentication -> Principal & GrantAuthority
SecurityContextHolder
- SecurityContext를 제공하는 static 메소드(getContext)를 지원한다SecurityContext
- 접근 주체와 인증에 대한 정보를 담고 있는 Context이다.
- 즉, Authentication을 담고있다
Authentication
- Principal, GrantAuthority를 제공한다
- 인증이 이루어지면 해당 Authentication이 저장된다
Principal
- 유저에 대한 정보
- 대부분 Principal로 UserDetails를 반환한다
GrantAuthority
- ROLE_ADMIN, ROLE_USER 등 Principal이 가지고 있는 권한을 나타낸다
- 권한은 여러개 일 수 있기 때문에 Collection형태로 제공한다
| 예제
'📚 Spring > Spring-Security' 카테고리의 다른 글
[Spring Security] 2. Form Login 필터 : UsernamePasswordAuthenticationFilter (0) | 2022.03.03 |
---|---|
[Spring Security] Form Login 인증방식 (0) | 2022.03.02 |
[Spring Security] Security Filter 의 종류 (0) | 2022.02.13 |
[Spring Security] ThreadLocal (0) | 2022.02.09 |
[Spring Security] Spring Security 란? (0) | 2022.02.09 |