fedletXACMLResp.jsp revision 8589dad18873c72c72a41284cf70a88eb0c56f79
1078b2c97bb39352bae929d2ed3f290a420470a7ianh The contents of this file are subject to the terms
af262486b3d1c33299307195a715bd1e373f99afrbb of the Common Development and Distribution License
af262486b3d1c33299307195a715bd1e373f99afrbb (the License). You may not use this file except in
af262486b3d1c33299307195a715bd1e373f99afrbb compliance with the License.
af262486b3d1c33299307195a715bd1e373f99afrbb You can obtain a copy of the License at
628ce9384209a460022be952ccdcc8538ad3ca84slive See the License for the specific language governing
628ce9384209a460022be952ccdcc8538ad3ca84slive permission and limitations under the License.
2b9a9a94658c0febcad2f76621b2d5ab856edc6atrawick When distributing Covered Code, include this CDDL
2b9a9a94658c0febcad2f76621b2d5ab856edc6atrawick Header Notice in each file and include the License file
2b9a9a94658c0febcad2f76621b2d5ab856edc6atrawick If applicable, add the following below the CDDL Header,
f6f453bf03007f391d347dc821e507cdd924d1bftrawick with the fields enclosed by brackets [] replaced by
f6f453bf03007f391d347dc821e507cdd924d1bftrawick your own identifying information:
f6f453bf03007f391d347dc821e507cdd924d1bftrawick "Portions Copyrighted [year] [name of copyright owner]"
f6f453bf03007f391d347dc821e507cdd924d1bftrawick Copyright 2009 Sun Microsystems Inc. All Rights Reserved
205f4595abf32ae208958d7f8abea68b335c9f39trawick Portions Copyrighted 2013-2016 ForgeRock AS.
1078b2c97bb39352bae929d2ed3f290a420470a7ianh This JSP used by the Fedlet performs the following:
1078b2c97bb39352bae929d2ed3f290a420470a7ianh 1) Retrieves the list of attributes from fedletXACMLQuery.jsp
1078b2c97bb39352bae929d2ed3f290a420470a7ianh 2) Invokes the method to retrieve the policy decision for the Resource URL.
1078b2c97bb39352bae929d2ed3f290a420470a7ianh 3) Displays the Result.
611e46c801a6bd62e58a7f68abe1d2bbba473a92aaron<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
611e46c801a6bd62e58a7f68abe1d2bbba473a92aaron<%@ page import="com.sun.identity.saml2.profile.XACMLQueryUtil" %>
611e46c801a6bd62e58a7f68abe1d2bbba473a92aaron<%@ page import="org.owasp.esapi.ESAPI" %>
4224d5789080ea5586d49420da1e1996f5653bb5ianh String deployuri = request.getRequestURI();
fd3fa792f04fc9c4e8f5f83dceb0fc34e71f8570ianh int slashLoc = deployuri.indexOf("/", 1);
2d2e3667d789f527a04ce6a0089621470c8143ccmartin if (slashLoc != -1) {
2d2e3667d789f527a04ce6a0089621470c8143ccmartin deployuri = deployuri.substring(0, slashLoc);
2d2e3667d789f527a04ce6a0089621470c8143ccmartin <title>Sample Fedlet XACML Query Application</title>
2d2e3667d789f527a04ce6a0089621470c8143ccmartin <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
2d2e3667d789f527a04ce6a0089621470c8143ccmartin <link rel="stylesheet" type="text/css" href="<%= deployuri %>/com_sun_web_ui/css/css_ns6up.css" />
fd3fa792f04fc9c4e8f5f83dceb0fc34e71f8570ianh<div class="MstDiv"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblTop" title="">
fd3fa792f04fc9c4e8f5f83dceb0fc34e71f8570ianh<tbody><tr>
fd3fa792f04fc9c4e8f5f83dceb0fc34e71f8570ianh<td nowrap="nowrap"> </td>
fd3fa792f04fc9c4e8f5f83dceb0fc34e71f8570ianh<td nowrap="nowrap"> </td>
22d348febc3c258df246ac93e37945398dbf0348ianh</tr></tbody></table>
7a95e47ff0d0e4306df0901d56131b49dca5691etrawick<table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblBot" title="">
62af8654f682ca4913636bae099bec0befab985ctrawick<td class="MstTdTtl" width="99%">
62af8654f682ca4913636bae099bec0befab985ctrawick<div class="MstDivTtl"><img name="ProdName" src="<%= deployuri %>/console/images/PrimaryProductName.png" alt="" /></div></td><td class="MstTdLogo" width="1%"><img name="RMRealm.mhCommon.BrandLogo" src="<%= deployuri %>/com_sun_web_ui/images/other/javalogo.gif" alt="Java(TM) Logo" border="0" height="55" width="31" /></td></tr></tbody></table>
62af8654f682ca4913636bae099bec0befab985ctrawick<table class="MstTblEnd" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td><img name="RMRealm.mhCommon.EndorserLogo" src="<%= deployuri %>/com_sun_web_ui/images/masthead/masthead-sunname.gif" alt="Sun(TM) Microsystems,
1e557a77c091a1d2f2872872a7c20e9f2ffccbc1aaronInc." align="right" border="0" height="10" width="108" /></td></tr></tbody></table></div><div class="SkpMedGry1"><a name="SkipAnchor2089" id="SkipAnchor2089"></a></div>
1e557a77c091a1d2f2872872a7c20e9f2ffccbc1aaron<div class="SkpMedGry1"><a href="#SkipAnchor4928"><img src="<%= deployuri %>/com_sun_web_ui/images/other/dot.gif" alt="Jump Over Tab Navigation Area. Current Selection is: Access Control" border="0" height="1" width="1" /></a></div>
5e98e52df07f59be456af01ebf46d81defef2385trawick String idpEntityID = request.getParameter("idpEntityID");
5e98e52df07f59be456af01ebf46d81defef2385trawick if ((idpEntityID == null) ||
1e557a77c091a1d2f2872872a7c20e9f2ffccbc1aaron SAML2Utils.bundle.getString("nullIDPEntityID"));
b393bdb2e1eabbe4b9b37c5eaeeeca799b2eb324stoddard String spEntityID = request.getParameter("spEntityID");
6f912b4ad14f622aa8d57f887c8c745e13ff6dbfjerenkrantz if ((spEntityID == null) ||
3cd826b00280881e5a2f03d8ec1f8d55802b93dewrowe SAML2Utils.bundle.getString("nullSPEntityID"));
435c423bdcfa61ff871a9e289d1140f2bac839b8brianp String nameIDValue = request.getParameter("nameIDValue");
435c423bdcfa61ff871a9e289d1140f2bac839b8brianp String newNameIDValue = nameIDValue.replace("%2F","/");
e93cea6246ce30bf9791530a15c56f9e2eecf9cbianh String resource = request.getParameter("resource");
e93cea6246ce30bf9791530a15c56f9e2eecf9cbianh if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + resource,
f65342c1467751310036d4f9d75f554eaaf01cc6wrowe resource, "HTTPParameterValue", 2000, false)){
f65342c1467751310036d4f9d75f554eaaf01cc6wrowe resource = "";
960eba6c6d512880c3ed0516f5d15c6e7bc7581ajerenkrantz String action = request.getParameter("action");
960eba6c6d512880c3ed0516f5d15c6e7bc7581ajerenkrantz String serviceName = "iPlanetAMWebAgentService";
45613d36b9466a48def0498cffa07f48980720f8jerenkrantz String policy_decision = XACMLQueryUtil.getPolicyDecisionForFedlet(
6f912b4ad14f622aa8d57f887c8c745e13ff6dbfjerenkrantz idpEntityID,
1abe6003aeb198cc97263503bceed457a6c2cb4aaaron newNameIDValue,
1abe6003aeb198cc97263503bceed457a6c2cb4aaaron serviceName,
cbd8d35ca8d9780f1081f30ebfe4abda44cab7ebianh<h2> Fedlet XACML Query Response </h2>
cbd8d35ca8d9780f1081f30ebfe4abda44cab7ebianh<table border="2" cellspacing="0" cellpadding="7">
0dc14774d2c21baf6123fcafdb853af5be1d97edwrowe<th>Resource</th>
3ad5a1fa75e728431fa7b8e3d8a74bcadcd79d4dlars<th>Policy Decision</th>
3fde4c273ea649d1320ec9c51e7d096cd9340a94jerenkrantz if(resource!=null) resource = ESAPI.encoder().encodeForHTML(resource);
0dc14774d2c21baf6123fcafdb853af5be1d97edwrowe out.println(policy_decision);
9f62694a8b4e2b88994a14555d144b3836b311cfstoddard } catch (Exception ex) {
9f62694a8b4e2b88994a14555d144b3836b311cfstoddard SAML2Utils.debug.error("Error sending XACML Query " , ex);