encode.jsp revision 47865bca6b632be56381a140939bdd446eec4514
5cd4555ad444fd391002ae32450572054369fd42Rob Austein DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews The contents of this file are subject to the terms
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater of the Common Development and Distribution License
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews (the License). You may not use this file except in
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews compliance with the License.
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews You can obtain a copy of the License at
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews https://opensso.dev.java.net/public/CDDLv1.0.html or
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews See the License for the specific language governing
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews permission and limitations under the License.
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews When distributing Covered Code, include this CDDL
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews Header Notice in each file and include the License file
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater If applicable, add the following below the CDDL Header,
26440aaebba1acb5c8810f7faa26ad3b7553762eMark Andrews with the fields enclosed by brackets [] replaced by
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews your own identifying information:
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews "Portions Copyrighted [year] [name of copyright owner]"
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews $Id: encode.jsp,v 1.13 2008/12/05 17:53:39 veiming Exp $
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews Portions copyright 2010-2014 ForgeRock AS.
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews<%@page contentType="text/html; charset=UTF-8" %>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews <title>OpenAM</title>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews <link rel="stylesheet" type="text/css" href="com_sun_web_ui/css/css_ns6up.css" />
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews <link rel="shortcut icon" href="com_sun_web_ui/images/favicon/favicon.ico" type="image/x-icon" />
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<%@page import="com.iplanet.sso.SSOException" %>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews<%@page import="com.iplanet.sso.SSOToken" %>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews<%@page import="com.sun.identity.security.EncodeAction" %>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews<%@page import="com.sun.identity.shared.locale.Locale" %>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews<%@page import="java.security.AccessController" %>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews<%@page import="java.util.ResourceBundle" %>
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews<body class="DefBdy">
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews <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">
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews <table class="MstTblBot" title="" border="0" cellpadding="0" cellspacing="0" width="100%">
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews <td class="MstTdTtl">
33d96fbbc8aa221508f3c780539bf44810fd2c9cMark Andrews <div class="MstDivTtl"><img name="AMConfig.configurator.ProdName" src="com_sun_web_ui/images/PrimaryProductName.png" alt="OpenAM" border="0" /></div>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <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>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td></td></tr></table>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<%@ include file="/WEB-INF/jsp/admincheck.jsp" %>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein SSOToken ssoToken = requireAdminSSOToken(request, response, out, "showServerConfig.jsp");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein if (ssoToken == null) {
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</body></html>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td>
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews String ssoPropLocale;
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews ssoPropLocale = ssoToken.getProperty("Locale");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein } catch (SSOException e) {
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein response.sendRedirect("UI/Login?goto=../encode.jsp");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein ResourceBundle rb =
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein ((ssoPropLocale != null) && (ssoPropLocale.length() > 0)) ?
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein ResourceBundle.getBundle("encode", Locale.getLocale(ssoPropLocale)) :
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein String strPwd = request.getParameter("password");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein if ((strPwd != null) && (strPwd.trim().length() > 0)) {
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein out.println(rb.getString("result-encoded-pwd") + " ");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein out.println(AccessController.doPrivileged(new EncodeAction(strPwd.trim())));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein out.println("<br /><br /><a href=\"encode.jsp\">" + rb.getString("encode-another-pwd") + "</a>");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein out.println("<form name=\"frm\" action=\"encode.jsp\" method=\"post\">");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein out.println("<input type=\"text\" name=\"password\" autocomplete=\"off\" />");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein out.println("<input type=\"submit\" value=\"" + rb.getString("btn-encode") + "\" />");
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </td></tr></table>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</body></html>