ConfigureSocialAuthN.jsp revision 3fc1b5e9b2ff286cd528a06154cc998198de1e70
1047N/A<%--
1047N/A ~ The contents of this file are subject to the terms of the Common Development and
1047N/A ~ Distribution License (the License). You may not use this file except in compliance with the
1047N/A ~ License.
1047N/A ~
1047N/A ~ You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
1047N/A ~ specific language governing permission and limitations under the License.
1047N/A ~
1047N/A ~ When distributing Covered Software, include this CDDL Header Notice in each file and include
1047N/A ~ the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
1047N/A ~ Header, with the fields enclosed by brackets [] replaced by your own identifying
1047N/A ~ information: "Portions copyright [year] [name of copyright owner]".
1047N/A ~
1047N/A ~ Copyright 2014 ForgeRock AS.
1047N/A--%>
1047N/A
1047N/A<%@page info="ConfigureSocialAuthN" contentType="text/html;charset=UTF-8" language="java" %>
1047N/A<%@page import="org.owasp.esapi.ESAPI" %>
1047N/A<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
1047N/A<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
1047N/A<%
1047N/A request.setCharacterEncoding("UTF-8");
1047N/A%>
1047N/A
1047N/A<jato:useViewBean
1047N/A className="com.sun.identity.console.task.ConfigureSocialAuthNViewBean"
1047N/A fireChildDisplayEvents="true" >
1047N/A
1047N/A <cc:i18nbundle baseName="amConsole" id="amConsole"
1047N/A locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
1047N/A
1047N/A <cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2014" fireDisplayEvents="true">
1935N/A
1047N/A <link rel="stylesheet" type="text/css" href="../console/css/openam.css" />
1047N/A <script language="javascript" src="../console/js/am.js"></script>
1907N/A <script language="javascript" src="../com_sun_web_ui/js/dynamic.js"></script>
1047N/A
1047N/A <div id="main" style="position: absolute; margin: 0; border: none; padding: 0; width: 100%; height: 101%;">
1935N/A <cc:form name="ConfigureSocialAuthN" method="post" defaultCommandChild="/btnSearch">
1935N/A <jato:hidden name="szCache" />
1935N/A
1047N/A <%-- HEADER --%>
1047N/A <script language="javascript">
1047N/A function confirmLogout() {
1047N/A return confirm("<cc:text name="txtLogout" defaultValue="masthead.logoutMessage" bundleID="amConsole"/>");
1907N/A }
1047N/A </script>
1047N/A <cc:primarymasthead name="mhCommon" bundleID="amConsole" logoutOnClick="return confirmLogout();"
1047N/A locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
1907N/A
1907N/A <table border="0" cellpadding="10" cellspacing="0" width="100%">
1047N/A <tr>
1047N/A <td>
1047N/A <cc:alertinline name="ialertCommon" bundleID="amConsole" />
1907N/A </td>
1047N/A </tr>
1907N/A </table>
1047N/A
1907N/A <%-- PAGE CONTENT --%>
1907N/A <cc:pagetitle name="pgtitle"
1907N/A bundleID="amConsole"
1907N/A pageTitleText="page.title.configure.social.authentication"
1907N/A showPageTitleSeparator="false"
1907N/A viewMenuLabel=""
1907N/A pageTitleHelpMessage="page.desc.configure.social.authentication"
1907N/A showPageButtonsTop="true"
1907N/A showPageButtonsBottom="false" >
1047N/A
1047N/A <cc:propertysheet
1047N/A name="propertyAttributes"
1047N/A bundleID="amConsole"
1047N/A showJumpLinks="false" />
1047N/A </cc:pagetitle>
1047N/A
1047N/A </cc:form>
1047N/A </div>
1935N/A <div id="dlg" class="dvs"></div>
1047N/A <script type="text/javascript">
1935N/A <!--
1047N/A var ajaxObj = getXmlHttpRequestObject();
1047N/A var userLocale = "<%= viewBean.getUserLocale().toString() %>";
1047N/A var msgConfiguring = "<p><img src=\"../console/images/processing.gif\" width=\"66\" height\"66\"/></p><cc:text name="txtConfiguring" defaultValue="social.configuration.waiting" bundleID="amConsole" escape="false" />";
1907N/A var msgConfigured = "<p>&nbsp;</p><input name=\"btnOK\" type=\"submit\" class=\"Btn1\" value=\"<cc:text name="txtOKBtn" defaultValue="ajax.ok.button" bundleID="amConsole" />\" onClick=\"document.location.replace(\'../task/Home\');return false;\" /></div></p>";
1047N/A var closeBtn = "<p>&nbsp;</p><p><div class=\"TtlBtnDiv\"><input name=\"btnClose\" type=\"submit\" class=\"Btn1\" value=\"<cc:text name="txtCloseBtn" defaultValue="ajax.close.button" bundleID="amConsole" />\" onClick=\"focusMain();return false;\" /></div></p>";
1047N/A
1047N/A var frm = document.forms['ConfigureSocialAuthN'];
1047N/A var btn1 = frm.elements['ConfigureSocialAuthN.button1'];
1047N/A btn1.onclick = submitPage;
1047N/A var btn2 = frm.elements['ConfigureSocialAuthN.button2'];
2210N/A btn2.onclick = cancelOp;
1516N/A <%
1907N/A String type = request.getParameter("type");
1907N/A if (!ESAPI.validator().isValidInput("Social AuthN Type", type, "HTTPParameterValue", 2000, true)) {
1907N/A type = null;
1907N/A }
1907N/A if (type != null) {
1907N/A out.println("var type = \"" + ESAPI.encoder().encodeForHTML(type) + "\";");
1907N/A } else {
1907N/A out.println("var type = null;");
1516N/A }
1907N/A %>
1907N/A
1907N/A function submitPage() {
1907N/A fade();
1047N/A document.getElementById('dlg').innerHTML = '<center>' + msgConfiguring + '</center>';
1907N/A var url = "../console/ajax/AjaxProxy.jsp";
1502N/A var params = 'locale=' + userLocale + '&class=com.sun.identity.workflow.ConfigureSocialAuthN' + getData();
1047N/A ajaxPost(ajaxObj, url, params, configured);
1047N/A return false;
1047N/A }
1907N/A
1047N/A function cancelOp() {
1047N/A document.location.replace("../task/Home");
1935N/A return false;
1047N/A }
1047N/A
1047N/A function getData() {
1935N/A var realm = frm.elements['ConfigureSocialAuthN.tfRealm'].value;
1047N/A var clientId = frm.elements['ConfigureSocialAuthN.tfClientId'].value;
1047N/A var clientSecret = frm.elements['ConfigureSocialAuthN.tfClientSecret'].value;
1047N/A var clientSecretConfirm = frm.elements['ConfigureSocialAuthN.tfConfirmSecret'].value;
1047N/A var redirectUrl = frm.elements['ConfigureSocialAuthN.tfRedirectUrl'].value;
1047N/A
1935N/A var params = "&realm=" + escapeEx(realm)
1047N/A + "&type=" + escapeEx(type)
1047N/A + "&clientId=" + escapeEx(clientId)
1047N/A + "&clientSecret=" + escapeEx(clientSecret)
1047N/A + "&clientSecretConfirm=" + escapeEx(clientSecretConfirm)
1907N/A + "&redirectUrl=" + escapeEx(redirectUrl);
1907N/A
1907N/A if (frm.elements['ConfigureSocialAuthN.tfDiscoveryUrl']) {
1907N/A var discoveryUrl = frm.elements['ConfigureSocialAuthN.tfDiscoveryUrl'].value;
1935N/A var imageUrl = frm.elements['ConfigureSocialAuthN.tfImageUrl'].value;
1047N/A var providerName = frm.elements['ConfigureSocialAuthN.tfProviderName'].value;
1047N/A
1047N/A params += "&discoveryUrl=" + escapeEx(discoveryUrl)
1047N/A + "&imageUrl=" + escapeEx(imageUrl)
1047N/A + "&providerName=" + escapeEx(providerName);
}
return params;
}
function configured() {
if (ajaxObj.readyState == 4) {
var result = hexToString(ajaxObj.responseText);
var status = result.substring(0, result.indexOf('|'));
var result = result.substring(result.indexOf('|') + 1);
var msg = '<center><p>' + result + '</p></center>';
if (status == 0) {
msg = msg + '<center>' + msgConfigured + '</center>';
} else {
msg = msg + '<center>' + closeBtn + '</center>';
}
document.getElementById('dlg').innerHTML = msg;
}
}
-->
</script>
<%-- END CONTENT --%>
</cc:header>
</jato:useViewBean>