|
@@ -36,17 +36,16 @@ public class WebLoginSuccessHandler implements AuthenticationSuccessHandler {
|
|
|
|
|
|
// 인증 ID
|
|
|
String userId = authentication.getName();
|
|
|
- log.info("Remote-IP/Session-ID/User-ID: {}/{}/{}", details.getRemoteAddress(), details.getSessionId(), userId);
|
|
|
+ log.info("login Remote-IP/Session-ID/User-ID: {}/{}/{}", details.getRemoteAddress(), details.getSessionId(), userId);
|
|
|
|
|
|
// 권한 리스트
|
|
|
List<GrantedAuthority> authList = new ArrayList<>(authentication.getAuthorities());
|
|
|
for (GrantedAuthority auth : authList) {
|
|
|
- log.info("Roll: {}", auth.getAuthority());
|
|
|
+ log.info("login Roll: {}", auth.getAuthority());
|
|
|
}
|
|
|
|
|
|
UserInfrVo userInfr = (UserInfrVo)authentication.getPrincipal();
|
|
|
String remoteIp = ItsUtils.getHttpServletRemoteIP(request);
|
|
|
- log.info("UserLogin: {}, {}", userInfr.getUserId(), remoteIp);
|
|
|
TbUserCnncHs cnncHs = TbUserCnncHs.builder()
|
|
|
.operSystId(userInfr.getOperSystId())
|
|
|
.userId(userInfr.getUserId())
|
|
@@ -54,6 +53,7 @@ public class WebLoginSuccessHandler implements AuthenticationSuccessHandler {
|
|
|
.logoutHms("")
|
|
|
.build();
|
|
|
this.cnncHsRepo.insertData(cnncHs.getOperSystId(), cnncHs.getLoginHms(), cnncHs.getUserId(), cnncHs.getLogoutHms());
|
|
|
+ log.info("login history: {}, {}", cnncHs, remoteIp);
|
|
|
|
|
|
//log.info("cnncHs: {}, {}", cnncHs.getUserId(), cnncHs.getLoginHms());
|
|
|
|
|
@@ -61,12 +61,14 @@ public class WebLoginSuccessHandler implements AuthenticationSuccessHandler {
|
|
|
String uri = defaultSuccessUrl;
|
|
|
String domain = "/";
|
|
|
|
|
|
- request.getSession().setAttribute(WebConstants.USER_UUID, WebMvcConfig.encUserId(cnncHs.getUserId()));
|
|
|
- request.getSession().setAttribute(WebConstants.USER_TIME, cnncHs.getLoginHms());
|
|
|
+ HttpSession session = request.getSession();
|
|
|
+ session.setAttribute(WebConstants.USER_UUID, WebMvcConfig.encUserId(cnncHs.getUserId()));
|
|
|
+ session.setAttribute(WebConstants.USER_TIME, cnncHs.getLoginHms());
|
|
|
+ session.setAttribute(WebConstants.LOGIN_USER, userInfr);
|
|
|
|
|
|
CookieUtils.setCookie(response, WebConstants.USER_UUID, WebMvcConfig.encUserId(cnncHs.getUserId()), 60*60, domain);
|
|
|
CookieUtils.setCookie(response, WebConstants.USER_TIME, cnncHs.getLoginHms(), 60*60, domain);
|
|
|
- CookieUtils.setCookie(response, "OPER_SYST_ID", userInfr.getOperSystId(), 60*60, domain);
|
|
|
+ CookieUtils.setCookie(response, WebConstants.USER_OPER_SYST_ID, userInfr.getOperSystId(), 60*60, domain);
|
|
|
|
|
|
// Security 가 요청을 가로챈 경우 사용자가 원래 요청했던 URI 정보를 저장한 객체
|
|
|
// RequestCache requestCache = new HttpSessionRequestCache();
|