Written by
spring-style
on
on
SecurityContextPersistenceFilter
SecurityContextPersistenceFilter
SecurityContextPersistenceFilter
- 기존에 인증된 정보가 있다면, 다음 요청에서 다시 인증하지 않도록 SecurityContext를 공유
- Spring Session을 활용하여 세션 클러스터를 구현할 수 있음
=> Spring Session을 활용하는 경우, 세션을 생성, 삭제하는 부분을 제대로 구현하지 않을 경우 memory leak이 발생할 수 있음.
서버 내부에서 세션을 생성하기 보다는 외부 데이터소스에 세션을 관리하여 세션 관리 모듈을 분리하는 것도 괜찮음. 단, 의존성이 생기기 때문에, 응답 지연, 에러처리 부분에 신경써야 함.
SecurityContextRepository
- SecurityContextPersistenceFilter가 기존의 SecurityContext를 가져오고 초기화하는데 사용
- loadContext
- saveContext
- containContext
반응형
from http://better-than-alone.tistory.com/129 by ccl(A) rewrite - 2021-12-08 02:27:58