idpSingleLogoutInit.jsp revision 0fdab8904a8fe223f6934b878769fe45e7651c60
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder The contents of this file are subject to the terms
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder of the Common Development and Distribution License
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder (the License). You may not use this file except in
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder compliance with the License.
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder You can obtain a copy of the License at
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder https://opensso.dev.java.net/public/CDDLv1.0.html or
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder See the License for the specific language governing
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder permission and limitations under the License.
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder When distributing Covered Code, include this CDDL
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder Header Notice in each file and include the License file
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder If applicable, add the following below the CDDL Header,
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder with the fields enclosed by brackets [] replaced by
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder your own identifying information:
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder "Portions Copyrighted [year] [name of copyright owner]"
51a70608c77400c4779e0ed000a2aedd0adecd14Christian Maeder $Id: idpSingleLogoutInit.jsp,v 1.9 2009/10/15 00:00:41 exu Exp $
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder Portions Copyrighted 2010-2013 ForgeRock AS
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder<%@ page import="com.iplanet.am.util.SystemProperties" %>
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder<%@ page import="com.sun.identity.plugin.session.SessionException" %>
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder<%@ page import="com.sun.identity.plugin.session.SessionManager" %>
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder<%@ page import="com.sun.identity.saml.common.SAMLUtils" %>
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder<%@ page import="com.sun.identity.saml2.common.SAML2Constants" %>
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
63bfead0a5fff45fd048df7cdae2c8b51574c6ecChristian Maeder<%@ page import="com.sun.identity.saml2.meta.SAML2MetaUtils" %>
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder<%@ page import="com.sun.identity.saml2.profile.IDPSingleLogout" %>
5dc4eccbc2a3a60f46c200d8b337a6c2f1d54144Christian Maeder<%@ 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("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());