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