fedletXACMLResp.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
25cf1a301a396c38e8adf52c15f537b80d2483f7jl The contents of this file are subject to the terms
25cf1a301a396c38e8adf52c15f537b80d2483f7jl of the Common Development and Distribution License
25cf1a301a396c38e8adf52c15f537b80d2483f7jl (the License). You may not use this file except in
25cf1a301a396c38e8adf52c15f537b80d2483f7jl compliance with the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl You can obtain a copy of the License at
25cf1a301a396c38e8adf52c15f537b80d2483f7jl See the License for the specific language governing
25cf1a301a396c38e8adf52c15f537b80d2483f7jl permission and limitations under the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl When distributing Covered Code, include this CDDL
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Header Notice in each file and include the License file
25cf1a301a396c38e8adf52c15f537b80d2483f7jl If applicable, add the following below the CDDL Header,
25cf1a301a396c38e8adf52c15f537b80d2483f7jl with the fields enclosed by brackets [] replaced by
25cf1a301a396c38e8adf52c15f537b80d2483f7jl your own identifying information:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl "Portions Copyrighted [year] [name of copyright owner]"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl Copyright 2009 Sun Microsystems Inc. All Rights Reserved
25cf1a301a396c38e8adf52c15f537b80d2483f7jl This JSP used by the Fedlet performs the following:
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 1) Retrieves the list of attributes from fedletXACMLQuery.jsp
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 2) Invokes the method to retrieve the policy decision for the Resource URL.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl 3) Displays the Result.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.shared.debug.Debug" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml.common.SAMLUtils" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.assertion.Assertion" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.assertion.AssertionFactory" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.assertion.Attribute" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.assertion.NameID" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.common.SAML2Constants" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.profile.XACMLQueryUtil" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="com.sun.identity.saml2.protocol.Response" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="java.util.ArrayList" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="java.util.Date" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="java.util.HashMap" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="java.util.Iterator" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="java.util.List" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="java.util.Map" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<%@ page import="org.owasp.esapi.ESAPI" %>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String deployuri = request.getRequestURI();
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int slashLoc = deployuri.indexOf("/", 1);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if (slashLoc != -1) {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl deployuri = deployuri.substring(0, slashLoc);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <title>Sample Fedlet XACML Query Application</title>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe <link rel="stylesheet" type="text/css" href="<%= deployuri %>/com_sun_web_ui/css/css_ns6up.css" />
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<div class="MstDiv"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblTop" title="">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<tbody><tr>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<td nowrap="nowrap"> </td>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<td nowrap="nowrap"> </td>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl</tr></tbody></table>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblBot" title="">
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<tbody><tr>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl<td class="MstTdTtl" width="99%">
0cc8ae8667155d352d327b5c92b62899a7e05bcdav<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>
0cc8ae8667155d352d327b5c92b62899a7e05bcdav<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,
0cc8ae8667155d352d327b5c92b62899a7e05bcdavInc." align="right" border="0" height="10" width="108" /></td></tr></tbody></table></div><div class="SkpMedGry1"><a name="SkipAnchor2089" id="SkipAnchor2089"></a></div>
0cc8ae8667155d352d327b5c92b62899a7e05bcdav<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>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String idpEntityID = request.getParameter("idpEntityID");
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ((idpEntityID == null) ||
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SAML2Utils.bundle.getString("nullIDPEntityID"));
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String spEntityID = request.getParameter("spEntityID");
25cf1a301a396c38e8adf52c15f537b80d2483f7jl if ((spEntityID == null) ||
25cf1a301a396c38e8adf52c15f537b80d2483f7jl SAML2Utils.bundle.getString("nullSPEntityID"));
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String nameIDValue = request.getParameter("nameIDValue");
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String newNameIDValue = nameIDValue.replace("%2F","/");
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String resource = request.getParameter("resource");
25cf1a301a396c38e8adf52c15f537b80d2483f7jl String action = request.getParameter("action");
String policy_decision = XACMLQueryUtil.getPolicyDecisionForFedlet(
if(resource!=null) resource = ESAPI.encoder().encodeForHTML(resource);
out.println("<tr>");
out.println("<td>");
out.println(resource);
out.println("</td>");
out.println("<td>");
out.println(policy_decision);
out.println("</td>");
SAML2Utils.debug.error("Error sending XACML Query " , ex);