fix: logout 처리

main
minuk926 2 years ago
parent 0034b36644
commit fc626eb744

@ -15,6 +15,8 @@ import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.stereotype.Controller;
@ -29,11 +31,12 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.fdl.security.config.SecurityConfig;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import kr.xit.framework.biz.mng.user.dto.XitUserInfoVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.dto.XitLoginVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.service.XitLoginService;
import kr.xit.framework.biz.mng.user.dto.XitUserInfoVO;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.constants.FrameworkConstants.USER_SE;
@ -200,7 +203,15 @@ public class XitLoginController {
public String actionLogout(HttpServletRequest request) {
request.getSession().setAttribute("XitLoginSession", null);
return "redirect:/egov_security_logout.do";
ApplicationContext act = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext());
SecurityConfig config = (SecurityConfig)act.getBean(SecurityConfig.class);
String logoutSuccessUrl = config.getLogoutSuccessUrl();
SecurityContext context = SecurityContextHolder.getContext();
context.setAuthentication(null);
//return "redirect:/egov_security_logout.do";
return "forward:" + logoutSuccessUrl;
}
/**
@ -260,8 +271,8 @@ public class XitLoginController {
/**
* <pre> : </pre>
* @param model
* @param session
* @param page
* @param vo
* @return
* @author:
* @throws Exception
@ -294,10 +305,8 @@ public class XitLoginController {
/**
* <pre> : </pre>
* @param model
* @param session
* @param xitUserInfoVO
* @return
* @param page
* @throws IOException
* @throws SQLException
* @throws RuntimeException String

@ -3,7 +3,6 @@ package kr.xit.framework.core.interceptor;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -15,15 +14,13 @@ import com.fasterxml.jackson.databind.JsonMappingException;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import kr.xit.framework.biz.cache.util.CacheServiceUtils;
import kr.xit.framework.biz.cmm.dto.XitLoginVO;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.support.exception.JSONExceptionMessageWriter;
import kr.xit.framework.support.util.Checks;
import kr.xit.framework.support.util.constants.Globals;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.extern.slf4j.Slf4j;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.service.XitFrameUnitService;
import kr.xit.framework.biz.cmm.dto.XitLoginVO;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
/**
*
@ -37,11 +34,7 @@ import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
*/
@Slf4j
@Service
public class XitMenuListIntercepter extends HandlerInterceptorAdapter {
@Resource
private XitFrameUnitService xitFrameUnitService;
@Resource
private XitFrameCrudService xitFrameCrudService;
public class MenuIntercepter extends HandlerInterceptorAdapter {
private Map<String, Integer> chkUrlAddLength;
@ -59,7 +52,7 @@ public class XitMenuListIntercepter extends HandlerInterceptorAdapter {
log.info("MenuList interceptor START !!");
log.debug("MenuIntercepter interceptor START !!");
/**
*
@ -143,7 +136,7 @@ public class XitMenuListIntercepter extends HandlerInterceptorAdapter {
log.info("MenuList interceptor COMPLETE !!");
log.debug("MenuIntercepter interceptor COMPLETE !!");
}

@ -25,7 +25,7 @@
<mvc:interceptor>
<!-- 대상 설정 -->
<mvc:mapping path="/**/*.do"/>
<bean class="kr.xit.framework.core.interceptor.XitMenuListIntercepter">
<bean class="kr.xit.framework.core.interceptor.MenuIntercepter">
<property name="chkUrlAddLength">
<map>
<entry key="/framework/biz/mng/bbs/BasicBbsMng" value="2"/>

Loading…
Cancel
Save