Configurator.jsp revision 45cbbdf2c42e20970c2539ba6cc4b94c2599c3d7
0N/A<%--
1472N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0N/A
0N/A Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
0N/A
0N/A The contents of this file are subject to the terms
0N/A of the Common Development and Distribution License
0N/A (the License). You may not use this file except in
0N/A compliance with the License.
0N/A
0N/A You can obtain a copy of the License at
0N/A https://opensso.dev.java.net/public/CDDLv1.0.html or
0N/A opensso/legal/CDDLv1.0.txt
0N/A See the License for the specific language governing
0N/A permission and limitations under the License.
0N/A
0N/A When distributing Covered Code, include this CDDL
0N/A Header Notice in each file and include the License file
1472N/A at opensso/legal/CDDLv1.0.txt.
1472N/A If applicable, add the following below the CDDL Header,
1472N/A with the fields enclosed by brackets [] replaced by
0N/A your own identifying information:
0N/A "Portions Copyrighted [year] [name of copyright owner]"
0N/A
0N/A $Id: Configurator.jsp,v 1.4 2009/11/03 00:51:42 madan_ranganath Exp $
0N/A
0N/A--%>
0N/A<%--
0N/A Portions Copyrighted 2012 ForgeRock Inc
0N/A Portions Copyrighted 2012 Open Source Solution Technology Corporation
0N/A--%>
0N/A
0N/A<html>
0N/A<head>
0N/A<title>Configure IDP Discovery Service</title>
0N/A<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
0N/A<link rel="stylesheet" type="text/css" href="com_sun_web_ui/css/css_ns6up.css" />
0N/A
0N/A
0N/A<%@ page import="
0N/Acom.sun.identity.saml2.idpdiscovery.IDPDiscoveryWARConfigurator,
0N/Acom.sun.identity.saml2.idpdiscovery.SystemProperties,
0N/Ajava.io.*,
0N/Ajava.security.AccessController,
0N/Ajava.util.Properties"
0N/A%>
0N/A
0N/A<%
0N/A String configFile = System.getProperty("user.home") +
0N/A File.separator + "libIDPDiscoveryConfig.properties";
0N/A String configTemplate = "/WEB-INF/classes/libIDPDiscoveryConfig.properties";
0N/A String errorMsg = null;
0N/A boolean configured = false;
0N/A String debugDir = null;
0N/A String debugLevel = null;
0N/A String cookieType = null;
0N/A String cookieDomain = null;
0N/A String secureCookie = null;
0N/A String encodeCookie = null;
0N/A String httpOnlyCookie = null;
0N/A
0N/A File configF = new File(configFile);
0N/A if (configF.exists()) {
0N/A errorMsg = "The IDP Discpvery Service have already been configued.<br>"
0N/A + "Configuration file : " + configFile + "<br><p><br>";
0N/A // reinitialize properties
0N/A SystemProperties.initializeProperties(configFile);
1291N/A configured = true;
0N/A } else {
0N/A debugLevel = request.getParameter("debugLevel");
0N/A cookieType = request.getParameter("cookieType");
0N/A cookieDomain = request.getParameter("cookieDomain");
0N/A secureCookie = request.getParameter("secureCookie");
0N/A debugDir = request.getParameter("debugDir");
0N/A encodeCookie = request.getParameter("encodeCookie");
0N/A httpOnlyCookie = request.getParameter("httpOnlyCookie");
1291N/A String submit = request.getParameter("submit");
0N/A String servletPath = request.getServletPath();
0N/A
0N/A if (submit != null) {
0N/A if ((debugLevel != null) && !debugLevel.equals("") &&
0N/A (cookieType != null) && !cookieType.equals("") &&
0N/A (secureCookie != null) && !secureCookie.equals("") &&
1291N/A (debugDir != null) && !debugDir.equals("") &&
0N/A (encodeCookie != null) && !encodeCookie.equals("") &&
0N/A (httpOnlyCookie != null) && !httpOnlyCookie.equals("")) {
0N/A if (cookieDomain == null) {
0N/A cookieDomain = "";
0N/A }
0N/A Properties props = new Properties();
0N/A props.setProperty("DEBUG_DIR", debugDir);
0N/A props.setProperty("DEBUG_LEVEL", debugLevel);
0N/A props.setProperty("COOKIE_TYPE", cookieType);
0N/A props.setProperty("COOKIE_DOMAIN", cookieDomain);
1291N/A props.setProperty("SECURE_COOKIE", secureCookie);
0N/A props.setProperty("ENCODE_COOKIE", encodeCookie);
0N/A props.setProperty("HTTP_ONLY_COOKIE", httpOnlyCookie);
1291N/A try {
1291N/A IDPDiscoveryWARConfigurator configurator =
1291N/A new IDPDiscoveryWARConfigurator(
1291N/A getServletConfig().getServletContext());
1291N/A configurator.createIDPDiscoveryConfig(configFile,
1291N/A configTemplate, props);
1291N/A configurator.setIDPDiscoveryConfig(configFile);
1291N/A } catch (IOException ioex) {
0N/A ioex.printStackTrace();
0N/A errorMsg = "Unable to create sample AMConfig.properties " +
0N/A "file: " + ioex.getMessage();
0N/A }
1291N/A configured = true;
0N/A } else {
0N/A errorMsg = "Missing one or more required fields.";
0N/A }
0N/A }
0N/A }
0N/A%>
0N/A
0N/A</head>
0N/A
0N/A<body class="DefBdy">
0N/A
0N/A<div class="MstDiv"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblTop" title="">
0N/A<tbody><tr>
0N/A<td nowrap="nowrap">&nbsp;</td>
0N/A<td nowrap="nowrap">&nbsp;</td>
0N/A</tr></tbody></table>
0N/A
0N/A<table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblBot" title="">
0N/A<tbody><tr>
0N/A<td class="MstTdTtl" width="99%">
0N/A<div class="MstDivTtl"><img name="ProdName" src="console/images/PrimaryProductName.png" alt="" /></div></td><td class="MstTdLogo" width="1%"><img name="RMRealm.mhCommon.BrandLogo" src="com_sun_web_ui/images/other/javalogo.gif" alt="Java(TM) Logo" border="0" height="55" width="31" /></td></tr></tbody></table>
0N/A<table class="MstTblEnd" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td><img name="RMRealm.mhCommon.EndorserLogo" src="com_sun_web_ui/images/masthead/masthead-sunname.gif" alt="Sun(TM) Microsystems, Inc." align="right" border="0" height="10" width="108" /></td></tr></tbody></table></div><div class="SkpMedGry1"><a name="SkipAnchor2089" id="SkipAnchor2089"></a></div>
0N/A<div class="SkpMedGry1"><a href="#SkipAnchor4928"><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump Over Tab Navigation Area. Current Selection is: Access Control" border="0" height="1" width="1" /></a></div>
0N/A
0N/A<table border="0" cellpadding="10" cellspacing="0" width="100%">
0N/A<tr><td>
0N/A
0N/A
0N/A<%
0N/A if (!configured) {
0N/A%>
0N/A
0N/A<h3>Configuring IDP Discovery Service</h3>
0N/A
0N/A<form action="Configurator.jsp" method="GET"
0N/A name="idpdiscoveryconfigurator">
1291N/A Please provide the IDP Discovery service information
1291N/A <p>&nbsp;</p>
1291N/A
0N/A <table border=0 cellpadding=5 cellspacing=0>
0N/A
0N/A<%
0N/A if (errorMsg != null) {
0N/A%>
0N/A <tr>
0N/A <td colspan="2" align="left">
0N/A <b><font color="red"><%= errorMsg %></font></b>
0N/A <br><br>
0N/A </td>
0N/A </tr>
0N/A<%
0N/A}
0N/A%>
0N/A
0N/A <tr>
0N/A <td>Debug directory</td>
0N/A <td><input name="debugDir" type="text" size="20" value="<%= debugDir == null ? "" : debugDir %>" /></td>
0N/A </tr>
0N/A <tr>
0N/A <td>Debug Level:</td>
0N/A <td>
0N/A <select name="debugLevel">
0N/A <option value ="error" selected="selected">error</option>
0N/A <option value ="warning">warning</option>
0N/A <option value ="message">message</option>
0N/A <option value ="off">off</option>
0N/A </select>
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td>Cookie Type:</td>
0N/A <td>
0N/A <input type="radio" name="cookieType" value="PERSISTENT" CHECKED>PERSISTENT
0N/A <input type="radio" name="cookieType" value="SESSION">SESSION
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td>Cookie Domain:</td>
0N/A <td><input name="cookieDomain" type="text" size="20" value="<%= cookieDomain == null ? "" : cookieDomain %>" /></td>
0N/A </tr>
0N/A <tr>
0N/A <td>Secure Cookie:</td>
0N/A <td>
0N/A <input type="radio" name="secureCookie" value="true">True
0N/A <input type="radio" name="secureCookie" value="false" CHECKED>False
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td>Encode Cookie:</td>
0N/A <td>
0N/A <input type="radio" name="encodeCookie" value="true" CHECKED>True
0N/A <input type="radio" name="encodeCookie" value="false">False
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td> </td>
0N/A </tr>
0N/A <tr>
0N/A <td>HTTP-Only Cookie:</td>
0N/A <td>
0N/A <input type="radio" name="httpOnlyCookie" value="true" >True
0N/A <input type="radio" name="httpOnlyCookie" value="false" CHECKED>False
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td colspan="2" align="center">
0N/A <input type="submit" name="submit" value="Configure" />
0N/A <input type="reset" value="Reset" />
0N/A </td>
0N/A </tr>
0N/A </table>
0N/A</form>
0N/A
0N/A<%
0N/A} else {
0N/A%>
0N/A<p>&nbsp;</p>
0N/A<%
0N/A if (errorMsg != null) {
0N/A%>
0N/A<%= errorMsg %>
0N/A<%
0N/A} else {
0N/A%>
0N/AIDP Discovery servce is successfully configured.<br>
0N/AConfiguration property is created at <%= configFile %><br>
0N/A<br>
0N/A<p>
0N/A<%
0N/A }
}
%>
</td></tr></table>
</body>
</html>