sso update
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
<%@ page language="java" contentType="text/html; charset=EUC-KR"
|
<%@ page language="java" contentType="text/html; charset=UTF8" pageEncoding="UTF-8"%>
|
||||||
pageEncoding="EUC-KR"%>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
|
||||||
<%
|
<%
|
||||||
@@ -11,18 +10,18 @@
|
|||||||
%>
|
%>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8>
|
||||||
<title>Insert title here</title>
|
<title>Insert title here</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h4>Single Sign On [<%=user_id %>]</h4>
|
<h4>Single Sign On [<%=user_id %>]</h4>
|
||||||
<font size=2>
|
<font size=2>
|
||||||
<b>[ 업무시스템 - (SAMPLE_APP)]</b>
|
<b>[ 업무시스템 - (SAMPLE_APP-UTF8)]</b>
|
||||||
</font>
|
</font>
|
||||||
|
|
||||||
<table border=0 width=700 cellpadding=4 cellspacing=1 style="border: solid 1px;">
|
<table border=0 width=700 cellpadding=4 cellspacing=1 style="border: solid 1px;">
|
||||||
<tr>
|
<tr>
|
||||||
<td width=200 bgcolor=#C3C3C3><font size=2>* 사용자ID</font></td>
|
<td width=200 bgcolor=#C3C3C3><font size=2>* 사용자ID</font></td>
|
||||||
<td><font size=2><%=user_id%></font></td>
|
<td><font size=2><%=user_id%></font></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -33,13 +32,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td width=200 bgcolor=#C3C3C3><font size=2>* 확장정보</font></td>
|
<td width=200 bgcolor=#C3C3C3><font size=2>* 확장정보</font></td>
|
||||||
<td><font size=2><%=ext_info%></font></td>
|
<td><font size=2><%=ext_info%></font></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td width=200 bgcolor=#C3C3C3><font size=2>* 인증토큰 상태</font></td>
|
<td width=200 bgcolor=#C3C3C3><font size=2>* 인증토큰 상태</font></td>
|
||||||
<td><font size=2>retCode = [<%=retCode%>] (1000:누락, 1001:시간, 1002:비정상)</font></td>
|
<td><font size=2>retCode = [<%=retCode%>] (1000:누락, 1001:시간, 1002:비정상)</font></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
|
||||||
<%@ page
|
<%@ page
|
||||||
import="sun.misc.*,
|
import="sun.misc.*,
|
||||||
java.util.*,
|
java.util.*,
|
||||||
@@ -294,3 +295,4 @@ System.out.println("nxef==="+ (String) nxef.getValue() ) ;
|
|||||||
}
|
}
|
||||||
|
|
||||||
%>
|
%>
|
||||||
|
Config
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<%@ page language="java" contentType="text/html;charset=EUC-KR" %>
|
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
|
||||||
<%@ include file="./config.jsp" %>
|
<%@ include file="./config.jsp" %>
|
||||||
|
test-1 <br />
|
||||||
<%
|
<%
|
||||||
|
|
||||||
String uurl = null;
|
String uurl = null;
|
||||||
@@ -7,43 +8,46 @@
|
|||||||
String service_id = null;
|
String service_id = null;
|
||||||
String ext_info = null;
|
String ext_info = null;
|
||||||
String retCode = null;
|
String retCode = null;
|
||||||
//http://test.kjbank.com:8080/se/login_exec.jsp : 꼭 도메인으로 호출해야 된다.
|
//http://test.kjbank.com:8080/se/login_exec.jsp : 꼭 도메인으로 호출해야 된다.
|
||||||
//1.SSO ID 수신
|
//1.SSO ID 수신
|
||||||
sso_id = getSsoId(request);
|
sso_id = getSsoId(request);
|
||||||
|
|
||||||
// 2. UURL 수신
|
// 2. UURL 수신
|
||||||
uurl = request.getParameter("UURL");
|
uurl = request.getParameter("UURL");
|
||||||
|
|
||||||
if (sso_id == null) {
|
if (sso_id == null) {
|
||||||
//uurl 이 없다면, 근데 여기서 uurl 은 뭘 체크하는거지? uurl 에 test.kjbank.com:8080/se/login_exec.jsp 를 넣는구나.
|
//uurl 이 없다면, 근데 여기서 uurl 은 뭘 체크하는거지? uurl 에 test.kjbank.com:8080/se/login_exec.jsp 를 넣는구나.
|
||||||
if (uurl == null) uurl = ASCP_URL;
|
if (uurl == null) uurl = ASCP_URL;
|
||||||
|
|
||||||
// 3. SSO 인증 정보가 없으면 통합 로그인 페이지로 이동
|
// 3. SSO 인증 정보가 없으면 통합 로그인 페이지로 이동
|
||||||
goLoginPage(response, uurl);
|
out.println("go sso login");
|
||||||
|
//goLoginPage(response, uurl);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//4.쿠키 유효성 확인 :0(정상)
|
//4.쿠키 유효성 확인 :0(정상)
|
||||||
retCode = getEamSessionCheck(request,response);
|
retCode = getEamSessionCheck(request,response);
|
||||||
|
out.println("retCode : " + retCode);
|
||||||
|
|
||||||
if(!retCode.equals("0")){
|
if(!retCode.equals("0")){
|
||||||
goErrorPage(response, Integer.parseInt(retCode));
|
out.println("go error page");
|
||||||
|
//goErrorPage(response, Integer.parseInt(retCode));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/***********************************************************************************
|
/***********************************************************************************
|
||||||
* < TO-DO >
|
* < TO-DO >
|
||||||
* SSO 통합 인증이 완료되었으므로, 업무 시스템 로그인은 건너뛰도록 코드를 수정합니다.
|
* SSO 통합 인증이 완료되었으므로, 업무 시스템 로그인은 건너뛰도록 코드를 수정합니다.
|
||||||
* SSO 에서 제공한 사번은 sso_id 변수에 저장되어 있습니다.
|
* SSO 에서 제공한 사번은 sso_id 변수에 저장되어 있습니다.
|
||||||
* 시스템에서 필요로 하는 세션 정보를 세팅 코드를 여기에 작성합니다.
|
* 시스템에서 필요로 하는 세션 정보를 세팅 코드를 여기에 작성합니다.
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
//5 확장 정보 조회
|
//5 확장 정보 조회
|
||||||
ext_info = getUserExField(sso_id, "CELLPHONENO");
|
ext_info = getUserExField(sso_id, "CELLPHONENO");
|
||||||
service_id = SERVICE_NAME;
|
service_id = SERVICE_NAME;
|
||||||
out.println ("SERVICE_NAME : " + service_id);
|
out.println ("SERVICE_NAME : " + service_id);
|
||||||
//
|
//
|
||||||
//6.업무시스템에 읽을 사용자 아이디를 세션으로 생성
|
//6.업무시스템에 읽을 사용자 아이디를 세션으로 생성
|
||||||
/* 변경 전
|
/* 변경 전
|
||||||
String EAM_ID = (String)session.getAttribute("SSO_ID");
|
String EAM_ID = (String)session.getAttribute("SSO_ID");
|
||||||
if(EAM_ID == null || EAM_ID.equals("")) {
|
if(EAM_ID == null || EAM_ID.equals("")) {
|
||||||
session.setAttribute("SSO_ID", sso_id);
|
session.setAttribute("SSO_ID", sso_id);
|
||||||
@@ -54,7 +58,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*변경 후*/
|
/*변경 후*/
|
||||||
if(!sso_id.replace(" ", "").equals("")) {
|
if(!sso_id.replace(" ", "").equals("")) {
|
||||||
session.setAttribute("SSO_ID", sso_id);
|
session.setAttribute("SSO_ID", sso_id);
|
||||||
session.setAttribute("APP_ID", service_id);
|
session.setAttribute("APP_ID", service_id);
|
||||||
@@ -66,19 +70,11 @@
|
|||||||
out.println ("EXT_INFO : " + ext_info);
|
out.println ("EXT_INFO : " + ext_info);
|
||||||
out.println ("RET_CODE : " + retCode);
|
out.println ("RET_CODE : " + retCode);
|
||||||
out.println ("ext_info : " + ext_info);
|
out.println ("ext_info : " + ext_info);
|
||||||
|
|
||||||
Properties info = ssoModule.getUserInfos(ssoId);
|
|
||||||
if (info != null) {
|
|
||||||
out.println("info - " + info.keySet());
|
|
||||||
info.keySet().forEach( k -> {
|
|
||||||
out.println(k + " - " + info.get(k));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
out.println("User info is null");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out.println("go app");
|
||||||
|
|
||||||
//7.업무시스템 페이지 호출(세션 페이지 또는 메인페이지 지정) --> 업무시스템에 맞게 URL 수정!
|
//7.업무시스템 페이지 호출(세션 페이지 또는 메인페이지 지정) --> 업무시스템에 맞게 URL 수정!
|
||||||
//response.sendRedirect(SERVER_URL + ":" + SERVER_PORT + "/se/app01.jsp");
|
//response.sendRedirect(SERVER_URL + ":" + SERVER_PORT + "/se/app01.jsp");
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
|
|||||||
Reference in New Issue
Block a user