idpSingleLogoutInit.jsp revision 0fdab8904a8fe223f6934b878769fe45e7651c60
32N/A $Id: idpSingleLogoutInit.jsp,v 1.9 2009/10/15 00:00:41 exu Exp $
851N/A<%@ page import="com.iplanet.am.util.SystemProperties" %>
32N/A<%@ page import="com.sun.identity.plugin.session.SessionException" %>
32N/A<%@ page import="com.sun.identity.plugin.session.SessionManager" %>
32N/A<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
493N/A<%@ page import="com.sun.identity.saml.common.SAMLUtils" %>
32N/A<%@ page import="com.sun.identity.saml2.common.SAML2Constants" %>
32N/A<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
851N/A<%@ page import="com.sun.identity.saml2.meta.SAML2MetaUtils" %>
32N/A<%@ page import="com.sun.identity.saml2.profile.IDPSingleLogout" %>
32N/A<%@ page import="com.sun.identity.saml2.profile.LogoutUtil" %>
606N/A<%@ page import="java.util.HashMap" %>
32N/A<%@ page import="org.owasp.esapi.ESAPI" %>
32N/A<%@ page import="java.io.PrintWriter" %>
if ((relayState == null) || (relayState.length() == 0)) {
if (!ESAPI.validator().isValidInput("HTTP Query String: " + relayState, relayState, "HTTPQueryString", 2000, true)) {
ssoToken = SessionManager.getProvider().getSession(request);
String intermmediatePage = SystemProperties.get(
if ( intermmediatePage.length() != 0 ) {
response.sendRedirect(intermmediatePage);
if (relayState != null && SAML2Utils.isRelayStateURLValid(request, relayState, SAML2Constants.IDP_ROLE) &&
ESAPI.validator().isValidInput("HTTP URL Value: " + relayState, relayState, "URL", 2000, true)) {
response.sendRedirect(relayState);
page="/saml2/jsp/default.jsp?message=idpSloSuccess" />
"nullSSOToken", SAML2Utils.bundle.getString("nullSSOToken"));
String[] values = SessionManager.getProvider().
getProperty(ssoToken, SAML2Constants.IDP_META_ALIAS);
if (values != null && values.length > 0) {
SessionManager.getProvider().invalidateSession(ssoToken, request, response);
if (relayState != null && SAML2Utils.isRelayStateURLValid(request, relayState, SAML2Constants.IDP_ROLE)) {
response.sendRedirect(relayState);
page="/saml2/jsp/default.jsp?message=idpSloSuccess" />
SAML2Utils.getSAML2MetaManager().getEntityByMetaAlias(metaAlias);
String realm = SAML2MetaUtils.getRealmByMetaAlias(metaAlias);
String binding = LogoutUtil.getSLOBindingInfo(request, metaAlias,
SAML2Constants.SP_ROLE, idpEntityID);
realm, idpEntityID, SAML2Constants.SLO_SERVICE, binding))
SAML2Utils.bundle.getString("unsupportedBinding"));
paramsMap.put("metaAlias", metaAlias);
IDPSingleLogout.initiateLogoutRequest(request,response, new PrintWriter(out, true),
if (!response.isCommitted()) {
if (relayState != null && SAML2Utils.isRelayStateURLValid(request, relayState, SAML2Constants.IDP_ROLE)) {
response.sendRedirect(relayState);
page="/saml2/jsp/default.jsp?message=idpSloSuccess" />
SAML2Utils.debug.error("Error sending Logout Request " , sse);
SAML2Utils.bundle.getString("LogoutRequestProcessingError") + " " +
sse.getMessage());
SAML2Utils.debug.error("Error processing Request ",e);
SAML2Utils.bundle.getString("LogoutRequestProcessingError") + " " +
e.getMessage());