일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- docker-compose
- Spring Open Feign
- docker compose mysql
- coalesce
- ChannelPipeline
- Netty
- cassandra
- Docker Compose
- Airflow
- MySQL
- redis
- Hibernate
- netflix oss
- mybatis
- spring cloud
- Redis Sentinel
- argo cd
- WebLogic
- spring boot
- weblogic 10
- RabbitMQ
- docker
- Selenium
- QueryDSL
- JPA
- KAFKA
- vue.js
- spring boot redis
- jmeter
- grafana
- Today
- Total
IT.FARMER
Spring Security logout Handler custom 본문
스프링시큐리티 구조를 이해 하기에 앞서
http://www.slideshare.net/madvirus/ss-36809454 이 자료를 읽어보면 많은 도움이 될거에요.
지금은 logout custom 을 하기위한 작업으로 SimpleUrlLogoutSuccessHandler
을 상속 받아 사용 하기로 한다.
security.xml
<security:logout
logout-url="/logout"
success-handler-ref="myLogoutSuccessHandler"
/>
@Component
public class MyLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler {
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
if (authentication != null) {
// do something
}
setDefaultTargetUrl("/login");
super.onLogoutSuccess(request, response, authentication);
}
}
로그아웃이 된데에 어디로 보낼지 setDefaultTargetUrl 에 담아 이동 하도록 한다.
stackoverflow 참고 자료.
'Spring > Spring Security' 카테고리의 다른 글
Spring Security 동적 권한 할당 (0) | 2016.10.19 |
---|---|
Spring security Session name 은 어느곳에? (0) | 2016.09.12 |
Spring Security Session 제어 (0) | 2014.11.06 |
Spring Security CSRF / filter / muiltipart-form (6) | 2014.11.06 |