느림보 개발
6. 로그아웃 본문
security-context
<!-- 로그아웃 -->
<security:logout logout-url="/logout" invalidate-session="true"/>
CommonController
@GetMapping("/logout")
public void loggoutGet() {
log.info("loggoutGet() - 로그아웃 실행");
}
jsp
- post형식으로 요청하므로 hidden으로 csrf 를 사용해준다.
<form action="/logout" method="post">
<input type="hidden" name="${_csrf.parameterName }" value="${_csrf.token }" />
<button>로그아웃</button>
</form>
'코드 정리 > Spring Security' 카테고리의 다른 글
5. 로그인 후 출력할 페이지 설정 (0) | 2023.01.20 |
---|---|
4. 커스텀 로그인 페이지 (0) | 2023.01.18 |
3. 접근 제한 메시지의 처리 (0) | 2023.01.17 |
2. 접근 제한 설정 및 여러 권한을 가지는 사용자 설정 (0) | 2023.01.16 |
1. 스프링 시큐리티 기본 설정 (0) | 2023.01.14 |
Comments