14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%--
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* Copyright 2012-2014 ForgeRock AS.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* The contents of this file are subject to the terms
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* of the Common Development and Distribution License
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* (the License). You may not use this file except in
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* You can obtain a copy of the License at
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* http://forgerock.org/license/CDDLv1.0.html
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* See the License for the specific language governing
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* permission and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* When distributing Covered Code, include this CDDL
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* Header Notice in each file and include the License file
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* at http://forgerock.org/license/CDDLv1.0.html
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* If applicable, add the following below the CDDL Header,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* with the fields enclosed by brackets [] replaced by
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* your own identifying information:
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* Portions Copyrighted 2012 [ForgeRock Inc]"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync Portions Copyrighted 2012-2015 ForgeRock AS.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync Portions Copyrighted 2015 Nomura Research Institute, Ltd.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync--%>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%@ page info="ConfigureOAuth2" language="java" %>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%@ page import="org.owasp.esapi.ESAPI" %>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%@taglib tagdir="/WEB-INF/tags" prefix="console"%>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync request.setCharacterEncoding("UTF-8");
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync%>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<jato:useViewBean
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync className="com.sun.identity.console.task.ConfigureOAuth2ViewBean"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync fireChildDisplayEvents="true" >
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<cc:i18nbundle baseName="amConsole" id="amConsole"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2008" fireDisplayEvents="true">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <link rel="stylesheet" type="text/css" href="../console/css/openam.css" />
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <script language="javascript" src="../console/js/am.js"></script>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <script language="javascript" src="../console/js/tasksPage.js"></script>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <script language="javascript" src="../com_sun_web_ui/js/dynamic.js"></script>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <div id="main" style="position: absolute; margin: 0; border: none; padding: 0; width:auto; height:101%;">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <div id="divhelp" style="display: none; position:absolute; margin: 0; border: 1px solid #AABCC8; padding: 0; width:400px; height:200px; background:#FCFCFC">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <table border=0 cellpadding=2 cellspacing=0 width="100%">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <tr><td width=99%><span id="divHelpmsg" /></td>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <td width="1%" valign="top">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <img src="../console/images/tasks/close.gif" width="16" height="16" onClick="hideHelp()" />
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </td>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </tr>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </table>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </div>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <cc:form name="ConfigureOAuth2" method="post">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <jato:hidden name="szCache" />
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <script language="javascript">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync function confirmLogout() {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync return confirm("<cc:text name="txtLogout" defaultValue="masthead.logoutMessage" bundleID="amConsole"/>");
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync }
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync function cancelOp() {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync redirectToXui();
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync return false;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync }
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </script>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <cc:primarymasthead name="mhCommon" bundleID="amConsole" logoutOnClick="return confirmLogout();" locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <table border="0" cellpadding="10" cellspacing="0" width="100%">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <tr>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <td>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <cc:alertinline name="ialertCommon" bundleID="amConsole" />
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </td>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </tr>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </table>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <%-- PAGE CONTENT --------------------------------------------------------- --%>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <cc:pagetitle name="pgtitle" bundleID="amConsole" showPageTitleSeparator="true" viewMenuLabel="" pageTitleHelpMessage="" showPageButtonsTop="true" showPageButtonsBottom="false" />
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync <cc:propertysheet name="propertyAttributes" bundleID="amConsole" showJumpLinks="false"/>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync </cc:form>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync</cc:header>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync</div>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<div id="dlg" class="dvs"></div>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<console:redirectToXui realm="encodeURIComponent(frm.elements['ConfigureOAuth2.tfRealm'].value)"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xuiPath="../XUI#realms/{realm}/dashboard"/>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<script language="javascript">
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar msgCreating = "<p><img src=\"../console/images/processing.gif\" width=\"66\" height\"66\"/></p><cc:text name="txtConfiguring" defaultValue="configuring.oauth2.waiting" bundleID="amConsole" escape="false" />";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar ttlCreated = "<h3><cc:text name="txtTtlCreated" defaultValue="oauth2.configured.title" escape="false" bundleID="amConsole" /></h3>";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar msgCreated = "<p>&nbsp;</p><input name=\"btnOK\" type=\"submit\" class=\"Btn1\" value=\"<cc:text name="txtOKBtn" defaultValue="ajax.ok.button" bundleID="amConsole" />\" onClick=\"redirectToXui();return false;\" /></div></p>";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar 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>";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar frm = document.forms['ConfigureOAuth2'];
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar btn1 = frm.elements['ConfigureOAuth2.button1'];
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncbtn1.onclick = submitPage;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar btn2 = frm.elements['ConfigureOAuth2.button2'];
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncbtn2.onclick = cancelOp;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar ajaxObj = getXmlHttpRequestObject();
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncvar userLocale = "<%= viewBean.getUserLocale().toString() %>";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync<%
String type = request.getParameter("type");
if (!ESAPI.validator().isValidInput("Social AuthN Type", type, "HTTPParameterValue", 2000, true)) {
type = null;
}
if (type != null) {
out.println("var type = \"" + ESAPI.encoder().encodeForHTML(type) + "\";");
} else {
out.println("var type = null;");
}
%>
function getData(){
var realm = frm.elements['ConfigureOAuth2.tfRealm'].value;
var rtl = frm.elements['ConfigureOAuth2.choiceRefreshLifetime'].value;
var acl = frm.elements['ConfigureOAuth2.choiceCodeLifetime'].value;
var atl = frm.elements['ConfigureOAuth2.choiceTokenLifetime'].value;
var irt = (frm.elements['ConfigureOAuth2.choiceRefreshToken'].checked == true) ? "true" : "false";
var irtr = (frm.elements['ConfigureOAuth2.choiceRefreshTokenOnRefreshing'].checked == true) ? "true" : "false";
var sic = frm.elements['ConfigureOAuth2.choiceScopeImpl'].value;
return "&realm=" + escapeEx(realm) +
"&type=" + escapeEx(type) +
"&rtl=" + escapeEx(rtl) +
"&acl=" + escapeEx(acl) +
"&atl=" + escapeEx(atl) +
"&irt=" + escapeEx(irt) +
"&irtr=" + escapeEx(irtr) +
"&sic=" + escapeEx(sic);
}
function submitPage() {
document.getElementById('dlg').style.top = '300px';
fade();
document.getElementById('dlg').innerHTML = '<center>' +
msgCreating + '</center>';
var url = "../console/ajax/AjaxProxy.jsp";
var params = 'locale=' + userLocale +
'&class=com.sun.identity.workflow.ConfigureOAuth2' + getData();
ajaxPost(ajaxObj, url, params, configured);
return false;
}
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 = '<center>' + ttlCreated + msg + msgCreated + '</center>';
} else {
msg = msg + '<center>' + closeBtn + '</center>';
}
document.getElementById('dlg').innerHTML = msg;
}
}
</script>
</jato:useViewBean>