Debug.jsp revision 5bdd6bf9211505ff52afc7e32bdc49cdfacf4879
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%--
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster opensso/legal/CDDLv1.0.txt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster at opensso/legal/CDDLv1.0.txt.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $Id: Debug.jsp,v 1.15 2009/01/28 05:35:06 ww203982 Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste--%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%--
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Portions Copyrighted 2010-2014 ForgeRock AS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster--%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%@ page pageEncoding="UTF-8" %>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%@ page
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster import="
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.iplanet.sso.SSOToken,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.sun.identity.saml2.common.SAML2Constants,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.sun.identity.saml2.common.SAML2SDKUtils,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.sun.identity.shared.configuration.SystemPropertiesManager,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.sun.identity.shared.debug.Debug,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.sun.identity.shared.encode.Hash,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.text.MessageFormat,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.ArrayList,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.Collections,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.Enumeration,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.HashMap,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.Iterator,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.List,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.Map,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.MissingResourceException,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster java.util.ResourceBundle,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster org.owasp.esapi.ESAPI"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<html xmlns="http://www.w3.org/1999/xhtml">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<head>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <title>OpenAM</title>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <link rel="stylesheet" type="text/css" href="com_sun_web_ui/css/css_ns6up.css" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <link rel="shortcut icon" href="com_sun_web_ui/images/favicon/favicon.ico" type="image/x-icon" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</head>
c423fd5d4f121413c5e72c134412b6ce5daa0dd9Jaco Jooste<body class="DefBdy">
c423fd5d4f121413c5e72c134412b6ce5daa0dd9Jaco Jooste <div class="SkpMedGry1"><a href="#SkipAnchor3860"><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1" /></a></div><div class="MstDiv">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <table class="MstTblBot" title="" border="0" cellpadding="0" cellspacing="0" width="100%">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <td class="MstTdTtl">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <div class="MstDivTtl"><img name="AMConfig.configurator.ProdName" src="com_sun_web_ui/images/PrimaryProductName.png" alt="OpenAM" border="0" /></div>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </tr>
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts </table>
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts </div>
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste <table class="SkpMedGry1" border="0" cellpadding="5" cellspacing="0" width="100%"><tr><td><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1" /></a></td></tr></table>
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td></td></tr></table>
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste<%@ include file="/WEB-INF/jsp/admincheck.jsp" %>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SSOToken ssoToken = requireAdminSSOToken(request, response, out, "showServerConfig.jsp");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (ssoToken == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
1563dad27ad07914e8f2ab1de04925eed4e188a4Peter Major</body></html>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String category = request.getParameter("category");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String instance = request.getParameter("instance");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String level = request.getParameter("level");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String samlDecryptionEnable = request.getParameter("samlDecryptionButton");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!ESAPI.validator().isValidInput("category", category, "HTTPParameterValue", 512, true)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster || !ESAPI.validator().isValidInput("instance", instance, "HTTPParameterValue", 512, true)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster || !ESAPI.validator().isValidInput("level", level, "HTTPParameterValue", 512, true)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster //Invalid values received, let's null them out and ignore them.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster category = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster instance = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster level = null;
f91e85a3e2672f40bcd3c857956397f3f7529b1cSachiko Wallace }
f91e85a3e2672f40bcd3c857956397f3f7529b1cSachiko Wallace boolean performAction = Boolean.valueOf(request.getParameter("do"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResourceBundle resourceBundle = ResourceBundle.getBundle("debug", request.getLocale());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResourceBundle rbFiles = ResourceBundle.getBundle("debugfiles");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Map categories = new HashMap();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster List<String> instances = new ArrayList<String>();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String formToken;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster formToken = Hash.hash(ssoToken.getTokenID().toString());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Make a copy to prevent ConcurrentModificationException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster List<Debug> temp = new ArrayList<Debug>(Debug.getInstances());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Debug debug : temp) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ("SAML2Decrypt".equalsIgnoreCase(debug.getName())) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster continue;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster instances.add(debug.getName());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Collections.sort(instances);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Enumeration e = rbFiles.getKeys(); e.hasMoreElements();) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String key = (String)e.nextElement();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ("SAML2Decrypt".equalsIgnoreCase(key)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster continue;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String val = rbFiles.getString(key);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster List lst = (List) categories.get(val);
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts if (lst == null) {
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts lst = new ArrayList();
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts }
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts lst.add(key);
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts categories.put(val, lst);
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts }
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste } catch (MissingResourceException e) {
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste out.println(e.getMessage());
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste return;
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste }
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste if (performAction) {
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste String receivedToken = request.getParameter("formToken");
ece5a262d20a50d0abf584d0f7ec73929ede9cfdJaco Jooste if (!formToken.equals(receivedToken)) {
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste out.println("Invalid form token provided!");
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste return;
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste }
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste if (samlDecryptionEnable != null) {
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste boolean enable = "Turn ON".equals(samlDecryptionEnable);
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste SystemPropertiesManager.initializeProperties(SAML2Constants.SAML_DECRYPTION_DEBUG_MODE, Boolean.toString(enable));
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste Debug.getInstance("SAML2Decrypt").setDebug(enable ? Debug.MESSAGE : Debug.ERROR);
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste }
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste }
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste%>
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste
590e03a0114f53c994d970cfb356dadaaa57e39dJaco Jooste<table cellpadding=5>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((instance == null || instance.length() == 0) && (category == null || category.length() == 0)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster || level == null || level.length() == 0
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<form name="frm" action="Debug.jsp" method="POST">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-category"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster:</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<select name="category">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Iterator i = categories.keySet().iterator(); i.hasNext(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String key = (String)i.next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<option>" + key + "</option>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</select>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>&nbsp;&nbsp;</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-level"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster:</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<select name="level">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<option value=\"1\">" +
1563dad27ad07914e8f2ab1de04925eed4e188a4Peter Major resourceBundle.getString("label-level-error") + "</option>");
1563dad27ad07914e8f2ab1de04925eed4e188a4Peter Major out.println("<option value=\"2\">" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resourceBundle.getString("label-level-warning") + "</option>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<option value=\"3\">" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resourceBundle.getString("label-level-message") + "</option>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</select>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td><input type="submit" value="Submit" class="Btn1" onclick="this.form.submit();" onmouseover="javascript: this.className='Btn1Hov'" onmouseout="javascript: this.className='Btn1'" onblur="javascript: javascript: this.className='Btn1'" onfocus="javascript: this.className='Btn1Hov'" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</form>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<form name="frm" action="Debug.jsp" method="POST">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-instance"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
1f6ad8dd55b6f7229c4fc203f55dc0b18a4450d9Andrew Forrest:</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<select name="instance">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (String inst : instances) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<option>" + inst + "</option>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</select>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>&nbsp;&nbsp;</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-level"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster:</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<select name="level">
1563dad27ad07914e8f2ab1de04925eed4e188a4Peter Major<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<option value=\"1\">" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resourceBundle.getString("label-level-error") + "</option>");
1563dad27ad07914e8f2ab1de04925eed4e188a4Peter Major out.println("<option value=\"2\">" +
1563dad27ad07914e8f2ab1de04925eed4e188a4Peter Major resourceBundle.getString("label-level-warning") + "</option>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<option value=\"3\">" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resourceBundle.getString("label-level-message") + "</option>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</select>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<td><input type="submit" value="Submit" class="Btn1" onclick="this.form.submit();" onmouseover="javascript: this.className='Btn1Hov'" onmouseout="javascript: this.className='Btn1'" onblur="javascript: javascript: this.className='Btn1'" onfocus="javascript: this.className='Btn1Hov'" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</form>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<p>&nbsp;</p>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<table border=1 cellpadding=5 cellspacing=0>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<th>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-category"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</th>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<th>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-filenames"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</th>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Iterator i = categories.keySet().iterator(); i.hasNext(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String key = (String)i.next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<tr><td valign=top><b>" + key + "</b></td>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster List values = (List)categories.get(key);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<td>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String msg = "message-category-"+key;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster msg = resourceBundle.getString("message-category-"+key);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (Exception ex) {}
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<b>"+msg+"</b><br>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.print("<span class=\"HlpFldTxt\">");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Iterator j = values.iterator(); j.hasNext(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println((String)j.next() + " " );
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.print("</span>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("</td></tr>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster} else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (category != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-category") + " = " + category);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ("Federation".equalsIgnoreCase(category)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (performAction && samlDecryptionEnable == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<br />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-saml-decryption-debug") + ": " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (SAML2SDKUtils.isSAMLDecryptionDebugEnabled() ? "ON" : "OFF"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<br />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <br />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <form name="samldecryptiondebug" action="Debug.jsp" method="POST">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <td><%= resourceBundle.getString("label-saml-decryption-debug") %></td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <td><input type="submit" class="Btn1" name="samlDecryptionButton" value="Turn <%= (SAML2SDKUtils.isSAMLDecryptionDebugEnabled() ? "OFF" : "ON\" onclick=\"return confirm('Enabling this option may result in sensitive data logged to the filesystem. Make sure you disable this option as soon as possible.');") %>" onmouseover="javascript: this.className='Btn1Hov'" onmouseout="javascript: this.className='Btn1'" onblur="javascript: javascript: this.className='Btn1'" onfocus="javascript: this.className='Btn1Hov'" /></td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (performAction) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-saml-decryption-debug-applied"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster %>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </td>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <input type="hidden" name="formToken" value="<%= formToken %>" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <input type="hidden" name="category" value="<%= category %>" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <input type="hidden" name="level" value="<%= level %>" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <input type="hidden" name="do" value="true" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </form>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<%
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("Instance" + " = " + instance);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<br />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String strLevel = "message";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (level.equals("1")) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster strLevel = "error";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (level.equals("2")) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster strLevel = "warning";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(resourceBundle.getString("label-level") + " = " + strLevel);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<br />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster int levelint = Integer.parseInt(level);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (category != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Object[] param = {strLevel};
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(MessageFormat.format(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resourceBundle.getString("message-setting-level-on-modules"), param));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<br />");
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts List values = (List)categories.get(category);
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts out.println("<ul>");
d135fba117a27e6d0de2f5518a274bba4c0a38efJames Phillpotts for (Iterator i = values.iterator(); i.hasNext(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String mname = (String)i.next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println( "<li>" + mname + "</li>" );
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
1563dad27ad07914e8f2ab1de04925eed4e188a4Peter Major if (performAction && (samlDecryptionEnable == null)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Debug debug = Debug.getInstance(mname);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.setDebug(levelint);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("</ul>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Object[] param = {strLevel, instance};
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(MessageFormat.format(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resourceBundle.getString("message-setting-level-on-instance"), param));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (performAction) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Debug.getInstance(instance).setDebug(levelint);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String backURL = "Debug.jsp";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!performAction || (performAction && (samlDecryptionEnable != null))) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<form name='frm' method='POST' action='Debug.jsp'>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (category != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<input name='category' type='hidden' value='" + category + "' />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<input name='instance' type='hidden' value='" + instance + "' />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<input name='level' type='hidden' value='" + levelint + "' />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<input name='do' type='hidden' value='true' />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<input type='hidden' name='formToken' value='" + formToken + "' />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<table border=0>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<tr><td>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<input type=\"button\" name=\"do\" value=\"" + resourceBundle.getString("button-confirm") + "\" class=\"Btn1\" onclick=\"this.form.submit();\" onmouseover=\"javascript: this.className='Btn1Hov'\" onmouseout=\"javascript: this.className='Btn1'\" onblur=\"javascript: javascript: this.className='Btn1'\" onfocus=\"javascript: this.className='Btn1Hov'\" /></form>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("</td><td>");
c423fd5d4f121413c5e72c134412b6ce5daa0dd9Jaco Jooste out.println("<input type=\"button\" name=\"back\" value=\"" + resourceBundle.getString("button-back") + "\" class=\"Btn1\" onclick=\"var elements=this.form.elements;for (var i=0;i<elements.length;i++){if(elements[i].type && elements[i].type==='hidden'){elements[i].value=''}};this.form.submit();\" onmouseover=\"javascript: this.className='Btn1Hov'\" onmouseout=\"javascript: this.className='Btn1'\" onblur=\"javascript: this.className='Btn1'\" onfocus=\"javascript: this.className='Btn1Hov'\" />");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("</td></tr></table>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("</form>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Object[] params = {backURL};
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println("<p>");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster out.println(MessageFormat.format(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster resourceBundle.getString("message-succeed"), params));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster%>
c423fd5d4f121413c5e72c134412b6ce5daa0dd9Jaco Jooste
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</td></tr>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</table>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</body>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster</html>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster