6.로그아웃
1. 로그아웃 처리
스프링 시큐리티는 기본적으로 /logout 경로를 통해 기본적인 로그아웃 기능을 제공함
1-2. 로그아웃 처리의 동작 과정
GET: /logout 경로로 요청 시 로그아웃 진행 여부에 대한 페이지를 응답,
POST: /logout 요청 시 LogoutHandler에 의해 아래와 같은 처리가 수행됨
-
Invalidate the HTTP session(SecurityContextLogoutHandler)
→ 세션 초기화 -
Clear theSecurityContextHolderStrategy(SecurityContextLogoutHandler) -
Clear theSecurityContextRepository(SecurityContextLogoutHandler)
→SecurityContextHolder관련 객체 초기화 -
Clean up anyRememberMe authentication (TokenRememberMeServices/PersistentTokenRememberMeServices)
→RememberMe인증 초기화 -
Clear out any savedCSRF token (CsrfLogoutHandler)
→CSRF토큰 초기화 -
FireaLogoutSuccessEvent(LogoutSuccessEventPublishingLogoutHandler)
→LogoutSuccessEvent호출
Last updated on