validator.jsp revision cf539ee6f2dcbcd1cdf6793e070ee116cdcb2aab
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James The contents of this file are subject to the terms
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James of the Common Development and Distribution License
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James (the License). You may not use this file except in
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James compliance with the License.
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James You can obtain a copy of the License at
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James https://opensso.dev.java.net/public/CDDLv1.0.html or
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James See the License for the specific language governing
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James permission and limitations under the License.
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James When distributing Covered Code, include this CDDL
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James Header Notice in each file and include the License file
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James If applicable, add the following below the CDDL Header,
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James with the fields enclosed by brackets [] replaced by
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James your own identifying information:
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James "Portions Copyrighted [year] [name of copyright owner]"
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James $Id: validator.jsp,v 1.8 2009/11/20 22:45:57 ggennaro Exp $
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James Portions Copyrighted 2013 ForgeRock AS
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page pageEncoding="UTF-8"%>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="com.sun.identity.common.SystemConfigurationUtil" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="com.sun.identity.shared.Constants" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="com.sun.identity.workflow.ValidateSAML2" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="com.sun.identity.workflow.WorkflowException" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="java.net.MalformedURLException" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="java.net.URL" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="java.net.URLEncoder" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="java.text.MessageFormat" %>
5d0dcd9820c04ac52a150525298eaae50c8b3544Mareks Malnacs<%@ page import="java.util.Locale" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="org.owasp.esapi.ESAPI" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James<%@ page import="org.apache.commons.lang.StringUtils" %>
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James String deployuri = null;
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James String serverURL = null;
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James URL url = new URL(request.getRequestURL().toString());
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James String prot = url.getProtocol();
e0d98b5e6f4b658de5303bf8d74576d2555db68eNicholas James String port = Integer.toString(url.getPort());
if (port.equals(-1)) {
port = prot.equals("http") ? "443" : "80";
deployuri = url.getPath();
int idx = deployuri.indexOf("/", 1);
deployuri = deployuri.substring(0, idx);
serverURL = prot + "://" + url.getHost() + ":" + port + deployuri;
deployuri = SystemConfigurationUtil.getProperty(
String serverProtocol = SystemConfigurationUtil.getProperty(
String serverHost = SystemConfigurationUtil.getProperty(
String serverPort = SystemConfigurationUtil.getProperty(
request.setCharacterEncoding("UTF-8");
String realm = request.getParameter("realm");
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + realm, realm, "HTTPParameterValue", 2000, false)) {
String cot = request.getParameter("cot");
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + cot, cot, "HTTPParameterValue", 2000, false)) {
String idp = request.getParameter("idp");
int start = idp.indexOf("(");
int end = idp.indexOf(")");
idpEntityID = s.toString();
idpMetaAlias = s.toString();
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + idp, idp, "HTTPParameterValue", 2000, false)) {
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + idpEntityID, idpEntityID, "HTTPParameterValue", 2000, false) ||
!ESAPI.validator().isValidInput("HTTP Parameter Value: " + idpMetaAlias, idpMetaAlias, "HTTPParameterValue", 2000, false)) {
String sp = request.getParameter("sp");
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + sp, sp, "HTTPParameterValue", 2000, false)) {
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>