Configurator.jsp revision a393c458f24ae38c8259dea2245aa436abe248f9
0N/A<%--
0N/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
0N/A at opensso/legal/CDDLv1.0.txt.
0N/A If applicable, add the following below the CDDL Header,
0N/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-2013 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 = "/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);
0N/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");
0N/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("") &&
0N/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);
0N/A props.setProperty("SECURE_COOKIE", secureCookie);
0N/A props.setProperty("ENCODE_COOKIE", encodeCookie);
0N/A props.setProperty("HTTP_ONLY_COOKIE", httpOnlyCookie);
0N/A try {
0N/A IDPDiscoveryWARConfigurator configurator =
0N/A new IDPDiscoveryWARConfigurator();
0N/A configurator.createIDPDiscoveryConfig(configFile,
0N/A configTemplate, props);
0N/A configurator.setIDPDiscoveryConfig(configFile);
0N/A } catch (IOException ioex) {
0N/A ioex.printStackTrace();
0N/A errorMsg = "Unable to create sample AMConfig.properties " +
0N/A "file: " + ioex.getMessage();
0N/A }
0N/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>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblBot" title="">
<tbody><tr>
<td class="MstTdTtl" width="99%">
<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>
<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>
<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>
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr><td>
<%
if (!configured) {
%>
<h3>Configuring IDP Discovery Service</h3>
<form action="Configurator.jsp" method="GET"
name="idpdiscoveryconfigurator">
Please provide the IDP Discovery service information
<p>&nbsp;</p>
<table border=0 cellpadding=5 cellspacing=0>
<%
if (errorMsg != null) {
%>
<tr>
<td colspan="2" align="left">
<b><font color="red"><%= errorMsg %></font></b>
<br><br>
</td>
</tr>
<%
}
%>
<tr>
<td>Debug directory</td>
<td><input name="debugDir" type="text" size="20" value="<%= debugDir == null ? "" : debugDir %>" /></td>
</tr>
<tr>
<td>Debug Level:</td>
<td>
<select name="debugLevel">
<option value ="error" selected="selected">error</option>
<option value ="warning">warning</option>
<option value ="message">message</option>
<option value ="off">off</option>
</select>
</td>
</tr>
<tr>
<td>Cookie Type:</td>
<td>
<input type="radio" name="cookieType" value="PERSISTENT" CHECKED>PERSISTENT
<input type="radio" name="cookieType" value="SESSION">SESSION
</td>
</tr>
<tr>
<td>Cookie Domain:</td>
<td><input name="cookieDomain" type="text" size="20" value="<%= cookieDomain == null ? "" : cookieDomain %>" /></td>
</tr>
<tr>
<td>Secure Cookie:</td>
<td>
<input type="radio" name="secureCookie" value="true">True
<input type="radio" name="secureCookie" value="false" CHECKED>False
</td>
</tr>
<tr>
<td>Encode Cookie:</td>
<td>
<input type="radio" name="encodeCookie" value="true" CHECKED>True
<input type="radio" name="encodeCookie" value="false">False
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>HTTP-Only Cookie:</td>
<td>
<input type="radio" name="httpOnlyCookie" value="true" >True
<input type="radio" name="httpOnlyCookie" value="false" CHECKED>False
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Configure" />
<input type="reset" value="Reset" />
</td>
</tr>
</table>
</form>
<%
} else {
%>
<p>&nbsp;</p>
<%
if (errorMsg != null) {
%>
<%= errorMsg %>
<%
} else {
%>
IDP Discovery servce is successfully configured.<br>
Configuration property is created at <%= configFile %><br>
<br>
<p>
<%
}
}
%>
</td></tr></table>
</body>
</html>