multi.jsp revision 984ea967792540448d05fba2ac6fad5dadf91fd6
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson<%--
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson The contents of this file are subject to the terms
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson of the Common Development and Distribution License
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson (the License). You may not use this file except in
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson compliance with the License.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson You can obtain a copy of the License at
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson https://opensso.dev.java.net/public/CDDLv1.0.html or
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson opensso/legal/CDDLv1.0.txt
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson See the License for the specific language governing
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson permission and limitations under the License.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson When distributing Covered Code, include this CDDL
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson Header Notice in each file and include the License file
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson at opensso/legal/CDDLv1.0.txt.
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson If applicable, add the following below the CDDL Header,
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson with the fields enclosed by brackets [] replaced by
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson your own identifying information:
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson "Portions Copyrighted [year] [name of copyright owner]"
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson $Id: multi.jsp,v 1.1 2009/07/02 22:00:17 exu Exp $
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson--%><%@page
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson import="com.sun.identity.wsfederation.common.WSFederationConstants"
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson import="com.sun.identity.plugin.session.SessionManager"
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson import="com.sun.identity.wsfederation.common.WSFederationUtils"
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson%><%
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson // handle multi-federation protocol case
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson Object uSession = null;
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson try {
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson uSession = SessionManager.getProvider().getSession(request);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson } catch (Exception e) {
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson }
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson if ((uSession == null) || !SessionManager.getProvider().isValid(uSession)) {
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson String wreply = request.getParameter(
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson WSFederationConstants.LOGOUT_WREPLY);
c3a558e7c77127215b010652905be7916ec5a080Sue Gleeson if ((wreply != null) && (wreply.length() != 0)) {
response.sendRedirect(wreply);
}
} else {
request.setAttribute(WSFederationConstants.LOGOUT_WREPLY,
request.getParameter(WSFederationConstants.LOGOUT_WREPLY));
request.setAttribute(WSFederationConstants.REALM_PARAM,
request.getParameter(WSFederationConstants.REALM_PARAM));
request.setAttribute(WSFederationConstants.ENTITYID_PARAM,
request.getParameter(WSFederationConstants.ENTITYID_PARAM));
WSFederationUtils.processMultiProtocolLogout(
request, response, uSession);
}
%>