validator.jsp revision daabd35ba2e339c503a3727ca75ea089edee7ede
0N/A $Id: validator.jsp,v 1.8 2009/11/20 22:45:57 ggennaro Exp $
0N/A<%@ page import="com.sun.identity.common.SystemConfigurationUtil" %>
0N/A<%@ page import="com.sun.identity.shared.Constants" %>
0N/A<%@ page import="com.sun.identity.workflow.ValidateSAML2" %>
0N/A<%@ page import="com.sun.identity.workflow.WorkflowException" %>
0N/A<%@ page import="java.net.MalformedURLException" %>
0N/A<%@ page import="java.net.URL" %>
0N/A<%@ page import="java.net.URLEncoder" %>
0N/A<%@ page import="java.text.MessageFormat" %>
0N/A<%@ page import="java.util.Locale" %>
0N/A<%@ page import="org.owasp.esapi.ESAPI" %>
0N/A<%@ page import="org.apache.commons.lang.StringUtils" %>
0N/A URL url = new URL(request.getRequestURL().toString());
0N/A String prot = url.getProtocol();
0N/A if (port.equals(-1)) {
0N/A port = prot.equals("http") ? "443" : "80";
0N/A deployuri = url.getPath();
0N/A int idx = deployuri.indexOf("/", 1);
0N/A deployuri = deployuri.substring(0, idx);
0N/A serverURL = prot + "://" + url.getHost() + ":" + port + deployuri;
0N/A deployuri = SystemConfigurationUtil.getProperty(
0N/A String serverProtocol = SystemConfigurationUtil.getProperty(
0N/A 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>