|
@@ -3,8 +3,11 @@ package com.style24.front.support.security;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
+import com.gagaframework.web.util.GagaCookieUtil;
|
|
|
|
|
+import com.style24.front.support.exception.TsfNonCertificationAccountException;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.security.authentication.AuthenticationProvider;
|
|
import org.springframework.security.authentication.AuthenticationProvider;
|
|
|
import org.springframework.security.authentication.BadCredentialsException;
|
|
import org.springframework.security.authentication.BadCredentialsException;
|
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
@@ -49,6 +52,11 @@ public class TsfAuthenticationProvider implements AuthenticationProvider {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private GagaPasswordEncoder passwordEncoder;
|
|
private GagaPasswordEncoder passwordEncoder;
|
|
|
|
|
|
|
|
|
|
+ @Value("${has-ssl}")
|
|
|
|
|
+ private String hasSsl;
|
|
|
|
|
+
|
|
|
|
|
+ private static final int LOGIN_FAIL_COUNT = 5; // 실패누적건수
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
|
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
|
|
String loginId = authentication.getName();
|
|
String loginId = authentication.getName();
|
|
@@ -78,7 +86,7 @@ public class TsfAuthenticationProvider implements AuthenticationProvider {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 로그인 실패누적건수가 5회 이상이면
|
|
// 로그인 실패누적건수가 5회 이상이면
|
|
|
- if (loginInfo.getLoginFailCnt() >= 5) {
|
|
|
|
|
|
|
+ if (loginInfo.getLoginFailCnt() >= LOGIN_FAIL_COUNT) {
|
|
|
throw new TsfLockedAccountException(message.getMessage("LOGN_0005"));
|
|
throw new TsfLockedAccountException(message.getMessage("LOGN_0005"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -93,9 +101,15 @@ public class TsfAuthenticationProvider implements AuthenticationProvider {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 본인인증이 필요한 회원
|
|
|
|
|
+ if (StringUtils.isBlank(loginInfo.getCi())) {
|
|
|
|
|
+ TsfSession.setAttribute("custNo", String.valueOf(loginInfo.getCustNo()));
|
|
|
|
|
+ throw new TsfNonCertificationAccountException(message.getMessage("LOGN_0009"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (TscConstants.CustStat.DORMANT.value().equals(loginInfo.getCustStat())) { // 휴면회원
|
|
if (TscConstants.CustStat.DORMANT.value().equals(loginInfo.getCustStat())) { // 휴면회원
|
|
|
|
|
|
|
|
- // 휴면해제를 위한 고객번호 세선저장
|
|
|
|
|
|
|
+ // 휴면해제를 위한 고객번호 세션저장
|
|
|
TsfSession.setAttribute("custNo", String.valueOf(loginInfo.getCustNo()));
|
|
TsfSession.setAttribute("custNo", String.valueOf(loginInfo.getCustNo()));
|
|
|
throw new TsfDormantAccountException(message.getMessage("LOGN_0006"));
|
|
throw new TsfDormantAccountException(message.getMessage("LOGN_0006"));
|
|
|
|
|
|