logout.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The contents of this file are subject to the terms
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of the Common Development and Distribution License
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (the License). You may not use this file except in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl compliance with the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl You can obtain a copy of the License at
25cf1a301a396c38e8adf52c15f537b80d2483f7jl See the License for the specific language governing
25cf1a301a396c38e8adf52c15f537b80d2483f7jl permission and limitations under the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When distributing Covered Code, include this CDDL
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Header Notice in each file and include the License file
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If applicable, add the following below the CDDL Header,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with the fields enclosed by brackets [] replaced by
116f76291c541446e47b233d739d94b4a7c675c2jfrank your own identifying information:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "Portions Copyrighted [year] [name of copyright owner]"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl $Id: logout.jsp,v 1.9 2009/07/02 22:00:17 exu Exp $
25cf1a301a396c38e8adf52c15f537b80d2483f7jl import="com.sun.identity.wsfederation.common.WSFederationConstants"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl import="com.sun.identity.multiprotocol.MultiProtocolUtils"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl import="com.sun.identity.multiprotocol.SingleLogoutManager"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String displayName =
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (String)request.getAttribute(WSFederationConstants.LOGOUT_DISPLAY_NAME);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String wreply =
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (String)request.getAttribute(WSFederationConstants.LOGOUT_WREPLY);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Map<String, String> providerList =
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (Map<String, String>)request.getAttribute(
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String uri = request.getRequestURI();
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String deploymentURI = uri;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int firstSlashIndex = uri.indexOf("/");
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int secondSlashIndex = uri.indexOf("/", firstSlashIndex+1);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if (secondSlashIndex != -1) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl deploymentURI = uri.substring(0, secondSlashIndex);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <title>Signing Out</title>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <script language="JavaScript">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl // handle multi-federation protocol case
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Object uSession = null;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uSession = SessionManager.getProvider().getSession(request);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl } catch (Exception e) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ((providerList != null) && !providerList.isEmpty()
25cf1a301a396c38e8adf52c15f537b80d2483f7jl && (uSession != null) &&
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SessionManager.getProvider().isValid(uSession) &&
25cf1a301a396c38e8adf52c15f537b80d2483f7jl StringBuffer redirectUrl = new StringBuffer();
25cf1a301a396c38e8adf52c15f537b80d2483f7jl redirectUrl.append(deploymentURI).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String realm = (String)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String idpEntityId = (String)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl request.getAttribute(WSFederationConstants.ENTITYID_PARAM);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ((realm != null) && (realm.length() != 0)) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl append("=").append(realm);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ((idpEntityId != null) && (idpEntityId.length() != 0)) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if (redirectUrl.toString().indexOf("?") == -1) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl redirectUrl.append(WSFederationConstants.ENTITYID_PARAM).
25cf1a301a396c38e8adf52c15f537b80d2483f7jl append("=").append(URLEncDec.encode(idpEntityId));
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ((wreply != null) && (wreply.length() != 0)) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if (redirectUrl.toString().indexOf("?") == -1) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl append("=").append(URLEncDec.encode(wreply));
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ((wreply != null) && (wreply.length() != 0)) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl function startTimer() {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl setTimeout(redirectToWReply,6000);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl setTimeout(redirectToWReply, 3000);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl function redirectToWReply () {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl document.location.href="<%=wreply%>";
25cf1a301a396c38e8adf52c15f537b80d2483f7jl function startTimer() {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <link rel="stylesheet" type="text/css" href="<%= deploymentURI %>/com_sun_web_ui/css/css_ns6up.css" />
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <link rel="shortcut icon" href="<%= deploymentURI %>/com_sun_web_ui/images/favicon/favicon.ico" type="image/x-icon" />
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <body class="DefBdy" onload="startTimer();">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <div class="SkpMedGry1"><a href="#SkipAnchor3860"><img src="<%= deploymentURI %>/com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1"></a></div><div class="MstDiv">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <table class="MstTblBot" title="" border="0" cellpadding="0" cellspacing="0" width="100%">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <td class="MstTdTtl" width="99%">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <div class="MstDivTtl"><img name="AMConfig.configurator.ProdName" src="<%= deploymentURI %>/console/images/PrimaryProductName.png" alt="OpenAM" border="0"></div>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <td class="MstTdLogo" width="1%"><img name="AMConfig.configurator.BrandLogo" src="<%= deploymentURI %>/com_sun_web_ui/images/other/javalogo.gif" alt="Java(TM) Logo" border="0" height="55" width="31"></td>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <table class="MstTblEnd" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img name="RMRealm.mhCommon.EndorserLogo" src="<%= deploymentURI %>/com_sun_web_ui/images/masthead/masthead-sunname.gif" alt="Sun(TM) Microsystems, Inc." align="right" border="0" height="10" width="108" /></td></tr></table>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <table class="SkpMedGry1" border="0" cellpadding="5" cellspacing="0" width="100%"><tr><td><img src="<%= deploymentURI %>/com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1"></td></tr></table>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td></td></tr></table>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <table cellpadding=5>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ( wreply!=null && wreply.length()>0 )
25cf1a301a396c38e8adf52c15f537b80d2483f7jl document.write("<p id=\"logoutPrompt\">Signing out of <%=displayName%></p>");
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <noscript>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <p><a href="<%=wreply%>">Click here</a> to continue</p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl </noscript>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl for ( String url : providerList.keySet() )
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <p>Signing out from <%=providerList.get(url)%></p>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <iframe width="500" src="<%=url%>"></iframe>