Spring Security - Logout API
2021. 4. 15. 11:35ㆍSPRING/SPRING SECURITY
사용 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | http .logout() // 로그아웃 기능 작동 .logoutUrl("/logout") //로그아웃 페이지 .logoutSuccessUrl("/login") // 로그아웃 성공 후 이동할 URL .deleteCookies("JSESSIONID", "remember-me") // 로그아웃 후 삭제할 쿠키 .addLogoutHandler(new LogoutHandler() { @Override public void logout(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) { //로그아웃시 추가적으로 수행할 로직 } }) .logoutSuccessHandler(new LogoutSuccessHandler() { @Override public void onLogoutSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException { //로그아웃 성공시 수행할 로직 } }) ; | cs |
'SPRING > SPRING SECURITY' 카테고리의 다른 글
Spring Security - 익명 사용자 인증, AnonymousAuthenticationFilter (0) | 2021.04.15 |
---|---|
Spring Security - Remember me, 자동 로그인 API, RememberMeAuthenticationFilter (0) | 2021.04.15 |
Spring Security - Logout 흐름, LogoutFilter (0) | 2021.04.15 |
SPRING SEQURITY - Form Login 인증 흐름, AuthenticationFilter (0) | 2021.04.15 |
SPRING SEQURITY - Form Login 인증 API (0) | 2021.04.15 |