|
@@ -6,12 +6,14 @@ import javax.servlet.ServletException;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.core.Authentication;
|
|
import org.springframework.security.core.Authentication;
|
|
|
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
|
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import com.style24.scm.biz.service.TssLoginService;
|
|
import com.style24.scm.biz.service.TssLoginService;
|
|
|
|
|
+import com.style24.scm.support.env.TssConstants;
|
|
|
import com.style24.scm.support.security.TssLoginDetails;
|
|
import com.style24.scm.support.security.TssLoginDetails;
|
|
|
import com.style24.scm.support.security.session.TssSession;
|
|
import com.style24.scm.support.security.session.TssSession;
|
|
|
|
|
|
|
@@ -68,6 +70,31 @@ public class TssLoginSuccessHandler implements AuthenticationSuccessHandler {
|
|
|
private void createSession(HttpServletRequest request, TssLoginDetails loginDetails) {
|
|
private void createSession(HttpServletRequest request, TssLoginDetails loginDetails) {
|
|
|
TssSession.getNewSess(request, -1);
|
|
TssSession.getNewSess(request, -1);
|
|
|
TssSession.setAttribute(request, loginDetails);
|
|
TssSession.setAttribute(request, loginDetails);
|
|
|
|
|
+
|
|
|
|
|
+ // 입점업체이면서
|
|
|
|
|
+ if ("G001_B000".equals(loginDetails.getLoginInfo().getRoleCd())) {
|
|
|
|
|
+ String headerAuthId = request.getHeader("x-auth-id"); // 샵링커: shoplinker, 사방넷: sabangnet, EC모니터: ecmonitor
|
|
|
|
|
+ String headerAuthKey = request.getHeader("x-auth-key"); // LOWER(FN_ENC_AES(위의 headerAuthId 값))
|
|
|
|
|
+ log.info("x-auth-id: {}, x-auth-key: {}", headerAuthId, headerAuthKey);
|
|
|
|
|
+
|
|
|
|
|
+ // Header에 인증ID와 인증키가 있으면
|
|
|
|
|
+ if (StringUtils.isNotBlank(headerAuthId) && StringUtils.isNotBlank(headerAuthKey)) {
|
|
|
|
|
+ String authKey = "";
|
|
|
|
|
+ if (headerAuthId.equals(TssConstants.SellerAuthKey.SHOPLINKER.name().toLowerCase())) {
|
|
|
|
|
+ authKey = TssConstants.SellerAuthKey.SHOPLINKER.value();
|
|
|
|
|
+ } else if (headerAuthId.equals(TssConstants.SellerAuthKey.SABANGNET.name().toLowerCase())) {
|
|
|
|
|
+ authKey = TssConstants.SellerAuthKey.SABANGNET.value();
|
|
|
|
|
+ } else if (headerAuthId.equals(TssConstants.SellerAuthKey.ECMONITOR.name().toLowerCase())) {
|
|
|
|
|
+ authKey = TssConstants.SellerAuthKey.ECMONITOR.value();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 입점업체의 인증키와 Header의 인증키가 같으면 2factor인증 skip을 위한 2factor인증 세션을 true로 설정
|
|
|
|
|
+ if (authKey.equals(headerAuthKey)) {
|
|
|
|
|
+ log.info("x-auth-key is equal!!!");
|
|
|
|
|
+ TssSession.setAttribute("isTfcertify", "true");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|