SSO 로그오프 방법 제공하기

인증서버의 로그오프 페이지를 호출할 수 있는 url을 설정해서 사용자가 필요에 따라 실행할 수 있도록 합니다.

샘플코드

default.jsp 일부
// 인증 객체 선언(Request와 Response 인계)
AuthCheck auth = new AuthCheck(request, response);

// 로그오프 URL 설정
logoffUrl = auth.getSsoSite().getLogoffUrl(request) + "?" +
        AuthUtil.ParamInfo.SITE_ID + "=" +
        auth.getSsoSite().getId() + "&" +
        auth.getSsoProvider().getParamName(AuthUtil.ParamInfo.RETURN_URL) + "=" +
        Utility.encodeUrl(auth.getThisUrl(), LiteralConst.UTF_8);       // ThisURL은 사용자가 현재 호출한 페이지의 URL
<a href="<%=logoffUrl%>">Logoff</a>

auth.getThisUrl()는 현재 Url을 자동으로 생성합니다.

만약 현재 Url이 맞지 않다면, 직접 문자열로 설정하여야 합니다.

Last updated

Was this helpful?