realmSelection.jsp revision 984ea967792540448d05fba2ac6fad5dadf91fd6
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
7a42357217528037bdfedcb17eeebfe96ae4266aAutomatic Updater Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater The contents of this file are subject to the terms
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater of the Common Development and Distribution License
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater (the License). You may not use this file except in
0519188c8e1ae76978fc4e0f799620cd36eba07aAutomatic Updater compliance with the License.
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater You can obtain a copy of the License at
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington https://opensso.dev.java.net/public/CDDLv1.0.html or
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater See the License for the specific language governing
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington permission and limitations under the License.
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater When distributing Covered Code, include this CDDL
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater Header Notice in each file and include the License file
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater If applicable, add the following below the CDDL Header,
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater with the fields enclosed by brackets [] replaced by
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews your own identifying information:
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews "Portions Copyrighted [year] [name of copyright owner]"
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater $Id: realmSelection.jsp,v 1.10 2009/10/29 00:00:00 exu Exp $
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater import="com.sun.identity.shared.debug.Debug"
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater import="com.sun.identity.wsfederation.common.WSFederationConstants"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson import="com.sun.identity.wsfederation.common.WSFederationUtils"
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater import="com.sun.identity.wsfederation.meta.WSFederationMetaManager"
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater import="com.sun.identity.wsfederation.meta.WSFederationMetaUtils"
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater import="com.sun.identity.wsfederation.jaxb.entityconfig.IDPSSOConfigElement"
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt import="com.sun.identity.wsfederation.jaxb.wsfederation.FederationElement"
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater String jspFile = "realmSelection.jsp: ";
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater String wreply = (String)request.getParameter("wreply");
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater String wctx = (String)request.getParameter("wctx");
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updater debug.message(jspFile + "wreply: "+wreply);
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater String spMetaAlias = WSFederationMetaUtils.getMetaAliasByUri(
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater if ( spMetaAlias==null || spMetaAlias.length()==0) {
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater response.sendError(response.SC_BAD_REQUEST, "Null metaAlias"
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater /* TODO SAML2Utils.bundle.getString("nullSPEntityID") */);
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater WSFederationMetaManager metaManager =
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews String spEntityId =
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews String spRealm = WSFederationMetaUtils.getRealmByMetaAlias(spMetaAlias);
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington Map<String,List<String>> spConfig =
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews metaManager.getSPSSOConfig(spRealm,spEntityId));
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater String accountRealmCookieName =
8e9f3b69914ee02a80b87c97b1f8093edb3e9ae0Automatic Updater spConfig.get(WSFederationConstants.ACCOUNT_REALM_COOKIE_NAME).get(0);
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater String selectedRealm = (String)request.getParameter("realm_list");
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater debug.message(jspFile + "Selected realm: " + selectedRealm);
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews if ( selectedRealm != null )
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews StringBuffer url = new StringBuffer(wreply);
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic Updater url.append(selectedRealm);
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews if (wctx != null) {
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews debug.message(jspFile + "Redirecting to: "+url);
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater String contextPath = request.getContextPath();
11af78f7dc35741bdab68dbab11b03daab005b28Automatic Updater<title>OpenSSO (Realm Selection)</title>
11af78f7dc35741bdab68dbab11b03daab005b28Automatic Updater<link rel="stylesheet" href="<%= contextPath %>/css/styles.css" type="text/css" />
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews<script language="JavaScript" src="<%= contextPath %>/js/browserVersion.js"></script>
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont<script language="JavaScript" src="<%= contextPath %>/js/auth.js"></script>
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater<script language="JavaScript">
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont writeCSS('<%= contextPath %>');
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater function formSubmit() {
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater var frm = document.forms['realm_form'];
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews if (frm != null) {
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater<script type="text/javascript"><!--// Empty script so IE5.0 Windows will draw table and button borders
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<body class="LogBdy" onload="placeCursorOnFirstElm();">
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic Updater <table border="0" cellpadding="0" cellspacing="0" align="center" title="">
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater <td width="50%"><img src="<%= contextPath %>/images/dot.gif" width="1" height="1" alt="" /></td>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <td><img src="<%= contextPath %>/images/dot.gif" width="728" height="1" alt="" /></td>
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater <td width="50%"><img src="<%= contextPath %>/images/dot.gif" width="1" height="1" alt="" /></td>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <tr class="LogTopBnd" style="background-image: url(<%= contextPath %>/images/gradlogtop.jpg);
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater background-repeat: repeat-x; background-position: left top;">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <td><img src="<%= contextPath %>/images/dot.gif" width="1" height="30" alt="" /></td>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <td> </td>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews <td class="LogMidBnd" style="background-image: url(<%= contextPath %>/images/gradlogsides.jpg);
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson background-repeat:repeat-x;background-position:left top;"> </td>
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater <td class="LogCntTd" style="background-image: url(<%= contextPath %>/images/login-backimage.jpg);
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater background-repeat:no-repeat;background-position:left top;" height="435" align="center" valign="middle">
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater <table border="0" background="<%= contextPath %>/images/dot.gif" cellpadding="0" cellspacing="0"
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater width="100%" title="">
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater <td width="260"><img src="<%= contextPath %>/images/dot.gif" width="260" height="245" alt="" /></td>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <td width="415" bgcolor="#ffffff" valign="top"><img name="Login.productLogo"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson src="<%= contextPath %>/images/PrimaryProductName.png" alt="OpenSSO"
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater <form name="realm_form" action="<%=request.getRequestURI()%>"
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater onSubmit="formSubmit(); return false;" method="post">
0ce87e5749aabb8eef1e0a37e4bd6e6ffa1d7196Automatic Updater <table border="0" cellspacing="0" cellpadding="0">
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater <td colspan="2">
765c97d56ccddc9d7904c7d9ff2e2d825d9687e4Automatic Updater <img src="<%= contextPath %>/images/dot.gif" width="1" height="25" alt="" />
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater <!-- Header display -->
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <td nowrap="nowrap"></td>
1d4f4d2db2d69e48fec2dde5c1535853677d22a7Automatic Updater <td><div class="logTxtSvrNam">
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater Account Realm Selection
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater <!-- End of Header display -->
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <!-- text box display -->
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <td nowrap="nowrap"><div class="logLbl">
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater <span class="LblLev2Txt">
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <label for="IDToken1">
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater </label></span></div>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater <td><div class="logInp">
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <input type="hidden" name="wreply" value="<%=wreply%>" />
5ecad47f69b3fd945472ab2900a9ff826a7ce2f6Automatic Updater if ( wctx != null && wctx.length() > 0 ) {
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <input type="hidden" name="wctx" value="<%=wctx%>" />
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrews <select name="realm_list">
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater String accountRealmCookieValue = null;
bbb069be941f649228760edcc241122933c066d2Automatic Updater Cookie cookies[] = request.getCookies();
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater if (cookies != null) {
4cda4fd158d6ded5586bacea8c388445d99611eaAutomatic Updater for (int i = 0; i < cookies.length; i++) {
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews if (cookies[i].getName().equals( accountRealmCookieName ))
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater accountRealmCookieValue = cookies[i].getValue();
765c97d56ccddc9d7904c7d9ff2e2d825d9687e4Automatic Updater debug.message(jspFile + "Account Realm Cookie: " +
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews accountRealmCookieValue);
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater for (String idpEntityId :
7a2a1b8b14fc804ac80612d7b98064095e445be5Automatic Updater metaManager.getAllRemoteIdentityProviderEntities(spRealm))
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater FederationElement idp =
3e5340279d8875d136a4dd815cccad0044aa2644Automatic Updater IDPSSOConfigElement idpconfig =
cf7e98f59148b559946a7f1ca728471374f1eef3Automatic Updater if ( metaManager.isTrustedProvider(spRealm,
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater spEntityId, idpEntityId) ) {
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater String issuerName = metaManager.
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater getTokenIssuerName(idp);
cf7e98f59148b559946a7f1ca728471374f1eef3Automatic Updater String displayName =
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updater WSFederationMetaUtils.getAttribute(idpconfig,
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater debug.message(jspFile + "account realm key: " +
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater issuerName + " display name: " + displayName);
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater if (displayName == null || displayName.length() == 0){
3857cb6fcabeb79d85de4b3e3e4ab99912b701f8Mark Andrews displayName = issuerName;
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <option value="<%=issuerName%>"
9174e44c14b1cb91a651fa1dc29470438c246ab9Automatic Updater <%=((accountRealmCookieValue != null) &&
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson (accountRealmCookieValue.equals(issuerName))?"selected":"")%>>
e2caa7536302de34de6cc04025abcd53dc3a499aAutomatic Updater <%=displayName%>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <!-- end of textBox -->
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <!-- Submit button -->
7d12a6b412fe47e6d6582923fd6954ab8cd0baebAutomatic Updater <td><img src="<%= contextPath %>/images/dot.gif"
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews width="1" height="15" alt="" /></td>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <script language="javascript">
3351ccbd5c1961404044f8273d54dad405f53960Mark Andrews markupButton(
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews "javascript:formSubmit()");
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews <!-- end of Submit button -->
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater <td> </td>
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater <td><img src="<%= contextPath %>/images/dot.gif"
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater width="1" height="33" alt="" /></td>
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater <td> </td>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater <td width="45"><img src="<%= contextPath %>/images/dot.gif"
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews width="45" height="245" alt="" /></td>
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews <td class="LogMidBnd" style="background-image: url(<%= contextPath %>/images/gradlogsides.jpg);
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews background-repeat:repeat-x;background-position:left top;"> </td>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <tr class="LogBotBnd" style="background-image: url(<%= contextPath %>/images/gradlogbot.jpg);
06f5acb11f1c32228d93eefd1eb841dbfb1c7f4dAutomatic Updater background-repeat:repeat-x;background-position:left top;">
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <td> </td>
7f79131f9a8e804b93c57f3c679065cce878b726Automatic Updater <td><div class="logCpy"><span class="logTxtCpy">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater Copyright © 2005 Sun Microsystems, Inc. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. This distribution may include materials developed by third parties.Sun, Sun Microsystems and the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.<br><br>Copyright © 2005 Sun Microsystems, Inc. Tous droits réservés.Sun Microsystems, Inc. détient les droits depropriété intellectuels relatifs à la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plus des brevets américains listés à l'adresse http://www.sun.com/patents et un ou les brevets supplémentaires ou les applications de brevet en attente aux Etats - Unis et dans les autres pays.L'utilisation est soumise aux termes du contrat de licence.Cette distribution peut comprendre des composants développés par des tierces parties.Sun, Sun Microsystems et le logo Sun sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays.</span></div>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews <td> </td>