validator.jsp revision 9740fa737ef2ed9453ab46d145777dbbbf6a747b
03831d35f7499c87d51205817c93e9a8d42c4baestevel DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
03831d35f7499c87d51205817c93e9a8d42c4baestevel Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
03831d35f7499c87d51205817c93e9a8d42c4baestevel The contents of this file are subject to the terms
03831d35f7499c87d51205817c93e9a8d42c4baestevel of the Common Development and Distribution License
03831d35f7499c87d51205817c93e9a8d42c4baestevel (the License). You may not use this file except in
03831d35f7499c87d51205817c93e9a8d42c4baestevel compliance with the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel You can obtain a copy of the License at
03831d35f7499c87d51205817c93e9a8d42c4baestevel See the License for the specific language governing
03831d35f7499c87d51205817c93e9a8d42c4baestevel permission and limitations under the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel When distributing Covered Code, include this CDDL
03831d35f7499c87d51205817c93e9a8d42c4baestevel Header Notice in each file and include the License file
03831d35f7499c87d51205817c93e9a8d42c4baestevel If applicable, add the following below the CDDL Header,
03831d35f7499c87d51205817c93e9a8d42c4baestevel with the fields enclosed by brackets [] replaced by
03831d35f7499c87d51205817c93e9a8d42c4baestevel your own identifying information:
03831d35f7499c87d51205817c93e9a8d42c4baestevel "Portions Copyrighted [year] [name of copyright owner]"
03831d35f7499c87d51205817c93e9a8d42c4baestevel $Id: validator.jsp,v 1.8 2009/11/20 22:45:57 ggennaro Exp $
03831d35f7499c87d51205817c93e9a8d42c4baestevel Portions Copyrighted 2013 ForgeRock AS
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page pageEncoding="UTF-8"%>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="com.sun.identity.common.SystemConfigurationUtil" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="com.sun.identity.shared.Constants" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="com.sun.identity.workflow.ValidateSAML2" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="com.sun.identity.workflow.WorkflowException" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="java.net.MalformedURLException" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="java.net.URL" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="java.net.URLEncoder" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="java.text.MessageFormat" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="java.util.Locale" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel<%@ page import="org.owasp.esapi.ESAPI" %>
03831d35f7499c87d51205817c93e9a8d42c4baestevel String deployuri = null;
03831d35f7499c87d51205817c93e9a8d42c4baestevel String serverURL = null;
03831d35f7499c87d51205817c93e9a8d42c4baestevel URL url = new URL(request.getRequestURL().toString());
03831d35f7499c87d51205817c93e9a8d42c4baestevel String prot = url.getProtocol();
03831d35f7499c87d51205817c93e9a8d42c4baestevel port = prot.equals("http") ? "443" : "80";
03831d35f7499c87d51205817c93e9a8d42c4baestevel deployuri = url.getPath();
03831d35f7499c87d51205817c93e9a8d42c4baestevel int idx = deployuri.indexOf("/", 1);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (idx != -1) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel deployuri = deployuri.substring(0, idx);
03831d35f7499c87d51205817c93e9a8d42c4baestevel serverURL = prot + "://" + url.getHost() + ":" + port + deployuri;
03831d35f7499c87d51205817c93e9a8d42c4baestevel } catch (MalformedURLException e) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel String serverProtocol = SystemConfigurationUtil.getProperty(
03831d35f7499c87d51205817c93e9a8d42c4baestevel String serverHost = SystemConfigurationUtil.getProperty(
03831d35f7499c87d51205817c93e9a8d42c4baestevel String serverPort = SystemConfigurationUtil.getProperty(
03831d35f7499c87d51205817c93e9a8d42c4baestevel serverURL = serverProtocol + "://" + serverHost + ":" +
03831d35f7499c87d51205817c93e9a8d42c4baestevel serverPort + deployuri;
03831d35f7499c87d51205817c93e9a8d42c4baestevel String realm = request.getParameter("realm");
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + realm, realm, "HTTPParameterValue", 2000, false)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel realm = "";
03831d35f7499c87d51205817c93e9a8d42c4baestevel String cot = request.getParameter("cot");
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + cot, cot, "HTTPParameterValue", 2000, false)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel String idp = request.getParameter("idp");
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + idp, idp, "HTTPParameterValue", 2000, false)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel String sp = request.getParameter("sp");
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + sp, sp, "HTTPParameterValue", 2000, false)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel String locale = request.getParameter("locale");
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + locale, locale, "HTTPParameterValue", 2000, false)) {
String authIDPPassed = ValidateSAML2.getMessage(
"validate.help.auth.idp.passed", locale);
String authIDPFailed = ValidateSAML2.getMessage(
"validate.help.auth.idp.failed", locale);
String authIDPAgain = ValidateSAML2.getMessage(
"validate.auth.idp.again", locale);
String authSPPassed = ValidateSAML2.getMessage(
"validate.help.auth.sp.passed", locale);
String authSPFailed = ValidateSAML2.getMessage(
"validate.help.auth.sp.failed", locale);
String authSPAgain = ValidateSAML2.getMessage(
"validate.auth.sp.again", locale);
String accLinkTitle = ValidateSAML2.getMessage(
"validate.title.account.linking", locale);
String accLinkPassed = ValidateSAML2.getMessage(
"validate.help.account.linking.passed", locale);
String accLinkFailed = ValidateSAML2.getMessage(
"validate.help.account.linking.failed", locale);
String sloTitle = ValidateSAML2.getMessage(
"validate.title.single.logout", locale);
String sloPassed = ValidateSAML2.getMessage(
"validate.help.single.logout.passed", locale);
String sloFailed = ValidateSAML2.getMessage(
"validate.help.single.logout.failed", locale);
String ssoPassed = ValidateSAML2.getMessage(
"validate.help.single.login.passed", locale);
String ssoFailed = ValidateSAML2.getMessage(
"validate.help.single.login.failed", locale);
String ssoAgain = ValidateSAML2.getMessage(
"validate.help.single.login.again", locale);
String accTermTitle = ValidateSAML2.getMessage(
"validate.title.account.termination", locale);
String accTermPassed = ValidateSAML2.getMessage(
"validate.help.account.termination.passed", locale);
String accTermFailed = ValidateSAML2.getMessage(
"validate.help.account.termination.failed", locale);
Object[] param = {validator.getIDPEntityId()};
"validate.title.auth.idp", locale), param);
Object[] param = {validator.getSPEntityId()};
"validate.title.auth.sp", locale), param);
if (validator.isIDPHosted()) {
Object[] param = {validator.getIDPEntityId()};
"validate.title.single.login_hosted", locale), param);
Object[] param = {validator.getSPEntityId()};
"validate.title.single.login_remote", locale), param);
setupFailedTitle = ValidateSAML2.getMessage(
"validate.title.setup.failed", locale);
if (setupError.length() > 0) {
out.println("logout();");
if (!validator.isFedlet()) {
out.println("setTimeout(\"authIdp()\", 3000);");
out.println("setTimeout(\"singleLogin()\", 3000);");
validator.getIDPLogoutURL() + "');");
if (!validator.isFedlet()) {
validator.getSPLogoutURL() + "');");
if ((validator != null) && !validator.isFedlet()) {
"?goto=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=idpauth&v=1") +
"&gotoOnFail=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=idpauth&v=-1") + "');");
window.scrollTo(0, 0);
top.showFooter('');
top.showFooter('');
if ((validator != null) && !validator.isFedlet()) {
"?goto=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=spauth&v=1") +
"&gotoOnFail=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=spauth&v=-1") + "');");
window.scrollTo(0, 50);
top.showFooter('');
top.showFooter('');
if ((validator != null) && !validator.isFedlet()) {
"&RelayState=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=acclink&v=1") + "');");
window.scrollTo(0, 150);
top.showFooter('');
top.showFooter('');
if ((validator != null) && !validator.isFedlet()) {
"&RelayState=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=slo&v=1") + "');");
window.scrollTo(0, 200);
top.showFooter('');
top.showFooter('');
if( validator.isSalesforceSP() ) {
"&RelayState=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=sso&v=1&sendRedirectForValidationNow=true") + "');");
window.scrollTo(0, 250);
var url = "validatorRpt.jsp";
out.println("url += '?idp=' + '" +
if (validator.isFedlet()) {
out.println("url += '&fedlet=' + '" +
out.println("url += '&sp=' + '" +
top.gotoURL(url);
top.showFooter('');
if (!validator.isFedlet()) {
out.println("accTermination();");
out.println("getReport();");
top.showFooter('');
top.showFooter('');
top.showFooter('');
"&RelayState=" + URLEncoder.encode(serverURL +
"/validatorStatus.jsp?s=accTerm&v=1") + "');");
window.scrollTo(0, 250);
<tr><td><img src="<%= deployuri %>/console/images/progressfailed.gif" width="28" height="26" /></td>
<td><span class="ProgressText" id="ErrorText"><%= ESAPI.encoder().encodeForHTML(setupError) %></span>
<tr><td><img src="<%= deployuri %>/console/images/progresspointer.gif" width="33" height="33" /></td>
<td><span class="ProgressTitle"><%=ESAPI.encoder().encodeForHTML(authIDPTitle) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspassed.gif" width="28" height="26" /></td>
<td><span class="ProgressDoneTitle"><%=ESAPI.encoder().encodeForHTML(authIDPPassed) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progressfailed.gif" width="28" height="26" /></td>
<td><span class="ProgressFailedTitle"><%= ESAPI.encoder().encodeForHTML(authIDPFailed) %></span></td>
<tr><td><div><img src="<%= deployuri %>/com_sun_web_ui/images/other/dot.gif" alt="" border="0" height="10" width="30" /></div></td>
<td><span class="ProgressText"><%=ESAPI.encoder().encodeForHTML(authSPTitle) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspointer.gif" width="33" height="33" /></td>
<td><span class="ProgressTitle"><%= ESAPI.encoder().encodeForHTML(authSPTitle) %></span><br /></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspassed.gif" width="28" height="26" /></td>
<td><span class="ProgressDoneTitle"><%=ESAPI.encoder().encodeForHTML(authSPPassed) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progressfailed.gif" width="28" height="26" /></td>
<td><span class="ProgressFailedTitle"><%=ESAPI.encoder().encodeForHTML(authSPFailed) %></span></td>
<tr><td><div><img src="<%= deployuri %>/com_sun_web_ui/images/other/dot.gif" alt="" border="0" height="10" width="30" /></div></td>
<td><span class="ProgressText"><%= ESAPI.encoder().encodeForHTML(accLinkTitle) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspointer.gif" width="33" height="33" /></td>
<td><span class="ProgressTitle"><%= ESAPI.encoder().encodeForHTML(accLinkTitle) %></span><br /></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspassed.gif" width="28" height="26" /></td>
<td><span class="ProgressDoneTitle"><%=ESAPI.encoder().encodeForHTML(accLinkPassed) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progressfailed.gif" width="28" height="26" /></td>
<td><span class="ProgressFailedTitle"><%=ESAPI.encoder().encodeForHTML(accLinkFailed) %></span></td>
<tr><td><div><img src="<%= deployuri %>/com_sun_web_ui/images/other/dot.gif" alt="" border="0" height="10" width="30" /></div></td>
<td><span class="ProgressText"><%= ESAPI.encoder().encodeForHTML(sloTitle) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspointer.gif" width="33" height="33" /></td>
<td><span class="ProgressTitle"><%= ESAPI.encoder().encodeForHTML(sloTitle) %></span><br /></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspassed.gif" width="28" height="26" /></td>
<td><span class="ProgressDoneTitle"><%=ESAPI.encoder().encodeForHTML(sloPassed) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progressfailed.gif" width="28" height="26" /></td>
<td><span class="ProgressFailedTitle"><%=ESAPI.encoder().encodeForHTML(sloFailed) %></span></td>
<tr><td><div><img src="<%= deployuri %>/com_sun_web_ui/images/other/dot.gif" alt="" border="0" height="10" width="30" /></div></td>
<td><span class="ProgressText"><%= ESAPI.encoder().encodeForHTML(ssoTitle) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspointer.gif" width="33" height="33" /></td>
<td><span class="ProgressTitle"><%= ESAPI.encoder().encodeForHTML(ssoTitle) %></span><br /></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspassed.gif" width="28" height="26" /></td>
<td><span class="ProgressDoneTitle"><%=ESAPI.encoder().encodeForHTML(ssoPassed) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progressfailed.gif" width="28" height="26" /></td>
<td><span class="ProgressFailedTitle"><%=ESAPI.encoder().encodeForHTML(ssoFailed) %></span></td>
<tr><td><div><img src="<%= deployuri %>/com_sun_web_ui/images/other/dot.gif" alt="" border="0" height="10" width="30" /></div></td>
<td><span class="ProgressText"><%= ESAPI.encoder().encodeForHTML(accTermTitle) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspointer.gif" width="33" height="33" /></td>
<td><span class="ProgressTitle"><%= ESAPI.encoder().encodeForHTML(accTermTitle) %></span><br /></td>
<tr><td><img src="<%= deployuri %>/console/images/progresspassed.gif" width="28" height="26" /></td>
<td><span class="ProgressDoneTitle"><%=ESAPI.encoder().encodeForHTML(accTermPassed) %></span></td>
<tr><td><img src="<%= deployuri %>/console/images/progressfailed.gif" width="28" height="26" /></td>
<td><span class="ProgressFailedTitle"><%=ESAPI.encoder().encodeForHTML(accTermFailed) %></span></td>