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