%-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved The contents of this file are subject to the terms of the Common Development and Distribution License (the License). You may not use this file except in compliance with the License. You can obtain a copy of the License at https://opensso.dev.java.net/public/CDDLv1.0.html or opensso/legal/CDDLv1.0.txt See the License for the specific language governing permission and limitations under the License. When distributing Covered Code, include this CDDL Header Notice in each file and include the License file at opensso/legal/CDDLv1.0.txt. If applicable, add the following below the CDDL Header, with the fields enclosed by brackets [] replaced by your own identifying information: "Portions Copyrighted [year] [name of copyright owner]" $Id: Configurator.jsp,v 1.10 2008/11/11 07:05:08 veiming Exp $ --%> <%-- Portions Copyrighted 2012 ForgeRock AS --%>
"
+ "Click here to go to the console.";
// reinitialize properties
Properties props = new Properties();
props.load(new FileInputStream(configFile));
SystemProperties.initializeProperties(props);
configured = true;
} else {
famProt = request.getParameter("famProt");
famHost = request.getParameter("famHost");
famPort = request.getParameter("famPort");
famDeploymenturi = request.getParameter("famDeploymenturi");
consoleProt = request.getParameter("consoleProt");
consoleHost = request.getParameter("consoleHost");
consolePort = request.getParameter("consolePort");
consoleDeploymenturi = request.getParameter("consoleDeploymenturi");
encPwd = request.getParameter("encPwd");
if (encPwd == null) {
encPwd = "";
}
debugDir = request.getParameter("debugDir");
appUser = request.getParameter("appUser");
appPassword = request.getParameter("appPassword");
String submit = request.getParameter("submit");
String servletPath = request.getServletPath();
if (submit != null) {
if ((famProt != null) && !famProt.equals("") &&
(famHost != null) && !famHost.equals("") &&
(famPort != null) && !famPort.equals("") &&
(famDeploymenturi != null) && !famDeploymenturi.equals("") &&
(consoleProt != null) && !consoleProt.equals("") &&
(consoleHost != null) && !consoleHost.equals("") &&
(consolePort != null) && !consolePort.equals("") &&
(consoleDeploymenturi != null) &&
!consoleDeploymenturi.equals("") &&
(debugDir != null) && !debugDir.equals("") &&
(appUser != null) && !appUser.equals("") &&
(appPassword != null) && !appPassword.equals("")) {
if (encPwd.length() != 0) {
SystemProperties.initializeProperties("am.encryption.pwd",
encPwd);
((ConfigurableKey) Crypt.getEncryptor()).setPassword(encPwd);
}
Properties props = new Properties();
props.setProperty("SERVER_PROTOCOL", famProt);
props.setProperty("SERVER_HOST", famHost);
props.setProperty("SERVER_PORT", famPort);
props.setProperty("DEPLOY_URI", famDeploymenturi);
props.setProperty("CONSOLE_PROTOCOL", consoleProt);
props.setProperty("CONSOLE_HOST", consoleHost);
props.setProperty("CONSOLE_PORT", consolePort);
props.setProperty("CONSOLE_DEPLOY_URI", consoleDeploymenturi);
props.setProperty("CONSOLE_REMOTE", "true");
props.setProperty("DEBUG_DIR", debugDir);
props.setProperty("NAMING_URL", famProt + "://" + famHost + ":"
+ famPort + famDeploymenturi + "/namingservice");
props.setProperty("NOTIFICATION_URL", consoleProt + "://"
+ consoleHost + ":" + consolePort + consoleDeploymenturi
+ "/notificationservice");
props.setProperty("DEBUG_LEVEL", "error");
props.setProperty("APPLICATION_USER", appUser);
props.setProperty("ENCODED_APPLICATION_PASSWORD", (String)
AccessController.doPrivileged(new EncodeAction(appPassword)));
// set empty application password
props.setProperty("APPLICATION_PASSWD", "");
props.setProperty("AM_COOKIE_NAME", "iPlanetDirectoryPro");
props.setProperty("ENCRYPTION_KEY", encPwd);
props.setProperty("ENCRYPTION_KEY_LOCAL", "");
props.setProperty("SESSION_PROVIDER_CLASS",
"com.sun.identity.plugin.session.impl.FMSessionProvider");
props.setProperty("CONFIGURATION_PROVIDER_CLASS",
"com.sun.identity.plugin.configuration.impl.ConfigurationInstanceImpl");
props.setProperty("DATASTORE_PROVIDER_CLASS",
"com.sun.identity.plugin.datastore.impl.IdRepoDataStoreProvider");
props.setProperty("CONFIG_DIR",
System.getProperty("user.home"));
try {
SetupClientWARSamples configurator =
new SetupClientWARSamples(
getServletConfig().getServletContext());
configurator.createAMConfigProperties(configFile,
configTemplate, props);
configurator.setAMConfigProperties(configFile);
} catch (IOException ioex) {
ioex.printStackTrace();
errorMsg = "Unable to create sample AMConfig.properties " +
"file: " + ioex.getMessage();
}
configured = true;
} else {
errorMsg = "Missing one or more required fields.";
}
} else {
// get local protocol/host/port as default for this console
if (consoleProt == null) {
consoleProt = request.getScheme();
}
if (consoleHost == null) {
consoleHost = request.getServerName();
}
if (consolePort == null) {
consolePort = "" + request.getServerPort();
}
if (consoleDeploymenturi == null) {
String tmp = request.getRequestURI();
int secondSlash = tmp.indexOf("/", 1);
if (secondSlash == -1) {
consoleDeploymenturi = tmp;
} else {
consoleDeploymenturi = tmp.substring(0, secondSlash);
}
}
}
}
%>
![]() |
<%
if (!configured) {
%>
Configuring OpenSSO Administration Console WAR<% } else { %><% if (errorMsg != null) { %> <%= errorMsg %> <% } else { %> The Administration Console only WAR had been successfully configured. AMConfig.properties created at <%= configFile %> Click here to go to the administration console. <% } } %> |