idpSingleLogoutInit.jsp revision 0e107349d3f7763a9c67fb2f32c86c11364c72cf
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass The contents of this file are subject to the terms
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass of the Common Development and Distribution License
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass (the License). You may not use this file except in
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass compliance with the License.
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass You can obtain a copy of the License at
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass https://opensso.dev.java.net/public/CDDLv1.0.html or
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass See the License for the specific language governing
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass permission and limitations under the License.
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass When distributing Covered Code, include this CDDL
$Id: idpSingleLogoutInit.jsp,v 1.9 2009/10/15 00:00:41 exu Exp $
<%@ page import="com.iplanet.am.util.SystemProperties" %>
<%@ page import="com.sun.identity.plugin.session.SessionException" %>
<%@ page import="com.sun.identity.plugin.session.SessionManager" %>
<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
<%@ page import="com.sun.identity.saml.common.SAMLUtils" %>
<%@ page import="com.sun.identity.saml2.common.SAML2Constants" %>
<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
<%@ page import="com.sun.identity.saml2.meta.SAML2MetaUtils" %>
<%@ page import="com.sun.identity.saml2.profile.IDPSingleLogout" %>
<%@ page import="com.sun.identity.saml2.profile.LogoutUtil" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="org.owasp.esapi.ESAPI" %>
<%@ 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("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)
&& ESAPI.validator().isValidInput("RelayState", relayState, "URL", 2000, true)) {
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(metaAlias, relayState, SAML2Constants.IDP_ROLE)
&& ESAPI.validator().isValidInput("RelayState", relayState, "URL", 2000, true)) {
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());