SSO 중복 로그온 선택 UI 구성하기
// 인증 객체 선언(Request와 Response 인계)
AuthCheck authCheck = new AuthCheck(Page.Request, Page.Response);
// 인증 체크(인증 상태 값 리턴)
AuthStatus status = authCheck.CheckLogon();
if (status == AuthStatus.SSOFail)
{
if (authCheck.ErrorCode == (int)AgentExceptionCode.SessionDuplicationCheckedLastPriority)
errorMessage = "Session was invalidated due to duplicated logon.\nIP:" +
authCheck.DuplicationIP + "\nTime:" + authCheck.DuplicationTime;
}protected string DuplicatedInfo = string.Empty;
protected string timeoutMinutes = string.Empty;
protected string dupUserID = string.Empty;
protected string dupIP = string.Empty;
protected string dupTime = string.Empty;
protected string ssoRequestString = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
// 전달받은 데이터 셋팅
ssoRequestString = Request["ssorequest"];
AuthCheck auth = new AuthCheck(Page.Request, Page.Response);
// 전달 받은 파라미터 유효성 확인
DupCheck dup = new DupCheck(auth);
// 페이지에 표시하기위한 데이터 정리.
dupUserID = dup.DupUserID;
dupIP = dup.DupUserIP;
dupTime = dup.DupTime;
timeoutMinutes = dup.TimeoutMinutes;
ssorequest.Value = ssoRequestString;
}
}
catch (AgentException aex)
{
Response.Write(aex.ToString());
}
catch (Exception ex)
{
Response.Write(ex.Message + "<br/>" + ex.StackTrace);
}
}
// 예 버튼 처리
protected void btnOK_Click(object sender, EventArgs e)
{
try
{
AuthCheck auth = new AuthCheck(Page.Request, Page.Response);
// 전달 받은 파라미터 유효성 확인
DupCheck dup = new DupCheck(auth);
dup.ProcessLogon();
}
catch (AgentException aex)
{
Response.Write(string.Format("오류코드 : {0}<br/>{1}<p/>", (int)aex.ExceptionCode, aex.ToString()));
}
catch (Exception ex)
{
Response.Write(ex.Message + "<br/>" + ex.StackTrace);
}
}
// 아니오 버튼 처리
protected void btnCancel_Click(object sender, EventArgs e)
{
try
{
AuthCheck auth = new AuthCheck(Page.Request, Page.Response);
// 전달 받은 파라미터 유효성 확인
DupCheck dup = new DupCheck(auth);
dup.ProcessCancel();
}
catch (AgentException aex)
{
Response.Write(string.Format("오류코드 : {0}<br/>{1}<p/>", (int)aex.ExceptionCode, aex.ToString()));
}
catch (Exception ex)
{
Response.Write(ex.Message + "<br/>" + ex.StackTrace);
}
}Last updated
Was this helpful?