ConfigureOAuth2.jsp revision 747557977e374069e102d06d5cc267d37e6b9b52
2801N/A<!--
2801N/A/*
2801N/A* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2801N/A*
2801N/A* Copyright 2012-2014 ForgeRock AS.
2801N/A*
2801N/A* The contents of this file are subject to the terms
2801N/A* of the Common Development and Distribution License
2801N/A* (the License). You may not use this file except in
2801N/A* compliance with the License.
2801N/A*
2801N/A* You can obtain a copy of the License at
2801N/A* http://forgerock.org/license/CDDLv1.0.html
2801N/A* See the License for the specific language governing
2801N/A* permission and limitations under the License.
2801N/A*
2801N/A* When distributing Covered Code, include this CDDL
2801N/A* Header Notice in each file and include the License file
2801N/A* at http://forgerock.org/license/CDDLv1.0.html
2801N/A* If applicable, add the following below the CDDL Header,
2801N/A* with the fields enclosed by brackets [] replaced by
2801N/A* your own identifying information:
3817N/A* "Portions Copyrighted [2012] [ForgeRock Inc]"
2801N/A*/
3998N/A-->
2801N/A
2801N/A<%--
2801N/A Portions Copyrighted 2015 ForgeRock AS.
3998N/A Portions Copyrighted 2015 Nomura Research Institute, Ltd.
3998N/A--%>
3998N/A
2801N/A<%@ page info="ConfigureOAuth2" language="java" %>
2801N/A<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
2801N/A<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
3998N/A<%
2801N/A request.setCharacterEncoding("UTF-8");
3533N/A%>
2801N/A<jato:useViewBean
4667N/A className="com.sun.identity.console.task.ConfigureOAuth2ViewBean"
2801N/A fireChildDisplayEvents="true" >
3998N/A
2899N/A<cc:i18nbundle baseName="amConsole" id="amConsole"
3817N/A locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
3817N/A
3817N/A<cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2008" fireDisplayEvents="true">
2801N/A
2801N/A <link rel="stylesheet" type="text/css" href="/console/css/openam.css" />
2801N/A <script language="javascript" src="/console/js/am.js"></script>
2801N/A <script language="javascript" src="/console/js/tasksPage.js"></script>
2801N/A <script language="javascript" src="/com_sun_web_ui/js/dynamic.js"></script>
4049N/A
2801N/A <div id="main" style="position: absolute; margin: 0; border: none; padding: 0; width:auto; height:101%;">
3998N/A <div id="divhelp" style="display: none; position:absolute; margin: 0; border: 1px solid #AABCC8; padding: 0; width:400px; height:200px; background:#FCFCFC">
2801N/A <table border=0 cellpadding=2 cellspacing=0 width="100%">
3998N/A <tr><td width=99%><span id="divHelpmsg" /></td>
3998N/A <td width="1%" valign="top">
3998N/A <img src="/console/images/tasks/close.gif" width="16" height="16" onClick="hideHelp()" />
3998N/A </td>
3998N/A </tr>
3998N/A </table>
3998N/A </div>
4667N/A
4667N/A <cc:form name="ConfigureOAuth2" method="post">
4667N/A <jato:hidden name="szCache" />
4667N/A <script language="javascript">
2801N/A function confirmLogout() {
2801N/A return confirm("<cc:text name="txtLogout" defaultValue="masthead.logoutMessage" bundleID="amConsole"/>");
2801N/A }
3358N/A
3998N/A function cancelOp() {
3998N/A document.location.replace("/task/Home");
2801N/A return false;
2801N/A }
2801N/A
2801N/A </script>
2801N/A
2801N/A <cc:primarymasthead name="mhCommon" bundleID="amConsole" logoutOnClick="return confirmLogout();" locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
2801N/A <table border="0" cellpadding="10" cellspacing="0" width="100%">
2801N/A <tr>
2801N/A <td>
4667N/A <cc:alertinline name="ialertCommon" bundleID="amConsole" />
4337N/A </td>
2801N/A </tr>
4285N/A </table>
4049N/A
4049N/A <%-- PAGE CONTENT --------------------------------------------------------- --%>
4049N/A <cc:pagetitle name="pgtitle" bundleID="amConsole" pageTitleText="page.title.configure.oauth2" showPageTitleSeparator="true" viewMenuLabel="" pageTitleHelpMessage="" showPageButtonsTop="true" showPageButtonsBottom="false" />
4049N/A
3817N/A <table border="0" cellpadding="20" cellspacing="0">
3817N/A <tr><td>
<cc:text name="txtDesc" defaultValue="page.desc.configure.oauth2" bundleID="amConsole" />
</td></tr>
</table>
<cc:propertysheet name="propertyAttributes" bundleID="amConsole" showJumpLinks="false"/>
</cc:form>
</cc:header>
</div>
<div id="dlg" class="dvs"></div>
<script language="javascript">
var 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" />";
var ttlCreated = "<h3><cc:text name="txtTtlCreated" defaultValue="oauth2.configured.title" escape="false" bundleID="amConsole" /></h3>";
var msgCreated = "<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>";
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>";
var frm = document.forms['ConfigureOAuth2'];
var btn1 = frm.elements['ConfigureOAuth2.button1'];
btn1.onclick = submitPage;
var btn2 = frm.elements['ConfigureOAuth2.button2'];
btn2.onclick = cancelOp;
var ajaxObj = getXmlHttpRequestObject();
var userLocale = "<%= viewBean.getUserLocale().toString() %>";
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) +
"&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>