인프런 커뮤니티 질문&답변

rere님의 프로필 이미지

작성한 질문수

스프링 시큐리티

3) 인증 개념 이해 - Authentication

강사님 세션과 관련해서 질문이 있습니다.

22.01.26 23:22 작성

·

238

0

강사님 안녕하세요. 항상 좋은 강의 감사드립니다!

 

세션과 관련해서 인증에 성공하면 JSESSIONID를 키로해서 세션 저장소에 SecurityContext를 저장하는데 이 작업을 SessionManagementfileter에서 하는지 아니면 usernamepasswordauthenticationfilter에서 하는지 궁금합니다.!

답변 1

3

정수원님의 프로필 이미지
정수원
지식공유자

2022. 01. 27. 22:05

SecurityContext 를 세션에 저장하는 역할은 SecurityContextPersistanceFilter 가 담당하고 있습니다.

SecurityContextPersistanceFilter 의 역할이 SecurityContext 를 생성, 삭제, 조회 등의 역할을 하고 있습니다.

Usernamepasswordauthenticationfilter 는 SecurityContext 안에 인증에 성공한 인증정보 즉 Authentication 객체를 저장하는 역할을 합니다.

SessionManagementfileter 는 사용자의 세션관리를 하지만 SecurityContext 를 저장하는 역할을 하지는 않습니다.

SecurityContextPersistanceFilter  강의챕터를 참고하시기 바랍니다.

rere님의 프로필 이미지

작성한 질문수

질문하기