fedletXACMLQuery.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
1N/A<%--
1N/A The contents of this file are subject to the terms
1N/A of the Common Development and Distribution License
1N/A (the License). You may not use this file except in
1N/A compliance with the License.
1N/A
1N/A You can obtain a copy of the License at
1N/A https://opensso.dev.java.net/public/CDDLv1.0.html or
1N/A opensso/legal/CDDLv1.0.txt
1N/A See the License for the specific language governing
1N/A permission and limitations under the License.
1N/A
1N/A When distributing Covered Code, include this CDDL
1N/A Header Notice in each file and include the License file
1N/A at opensso/legal/CDDLv1.0.txt.
1N/A If applicable, add the following below the CDDL Header,
1N/A with the fields enclosed by brackets [] replaced by
1N/A your own identifying information:
1N/A "Portions Copyrighted [year] [name of copyright owner]"
1N/A
1N/A Copyright 2009 Sun Microsystems Inc. All Rights Reserved
1N/A
1N/A--%>
1N/A
1N/A<%--
1N/A fedletXACMLQuery.jsp
1N/A This JSP used by the Fedlet to get the Resource URL. Fedlet uses XACML
1N/A to determine whether right policy has been defined for the Resource URL
1N/A--%>
1N/A
1N/A<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
1N/A<%@ page import="com.sun.identity.saml2.jaxb.metadata.IDPSSODescriptorElement" %>
1N/A<%@ page import="com.sun.identity.saml2.jaxb.metadata.SingleSignOnServiceElement" %>
1N/A<%@ page import="com.sun.identity.saml2.meta.SAML2MetaException" %>
1N/A<%@ page import="com.sun.identity.saml2.meta.SAML2MetaManager" %>
1N/A<%@ page import="com.sun.identity.shared.encode.URLEncDec" %>
1N/A<%@ page import="java.io.IOException" %>
1N/A<%@ page import="java.io.File" %>
1N/A<%@ page import="java.io.InputStream" %>
1N/A<%@ page import="java.io.FileOutputStream" %>
1N/A<%@ page import="java.util.ArrayList" %>
1N/A<%@ page import="java.util.Iterator" %>
1N/A<%@ page import="java.util.List" %>
1N/A<%@ page import="java.util.Map" %>
1N/A<%@ page import="java.util.Set" %>
1N/A
1N/A<%@ page import="com.sun.identity.cot.CircleOfTrustManager" %>
1N/A<%@ page import="com.sun.identity.saml2.jaxb.entityconfig.EntityConfigElement" %>
1N/A
1N/A<script>
1N/Afunction checkEmptyResource() {
1N/A if (document.fedletXACMLQuery.resource.value == "") {
1N/A alert("Resource URL cannot be empty");
1N/A return false;
1N/A }
1N/A return true;
1N/A}
1N/A</script>
1N/A<%
1N/A String deployuri = request.getRequestURI();
1N/A int slashLoc = deployuri.indexOf("/", 1);
1N/A if (slashLoc != -1) {
1N/A deployuri = deployuri.substring(0, slashLoc);
1N/A }
1N/A String fedletHomeDir = System.getProperty("com.sun.identity.fedlet.home");
1N/A if ((fedletHomeDir == null) || (fedletHomeDir.trim().length() == 0)) {
if (System.getProperty("user.home").equals(File.separator)) {
fedletHomeDir = File.separator + "fedlet";
} else {
fedletHomeDir = System.getProperty("user.home") +
File.separator + "fedlet";
}
}
%>
<html>
<head>
<title>XACML Query</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="<%= deployuri %>/com_sun_web_ui/css/css_ns6up.css" />
</head>
<body>
<div class="MstDiv"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblTop" title="">
<tbody><tr>
<td nowrap="nowrap">&nbsp;</td>
<td nowrap="nowrap">&nbsp;</td>
</tr></tbody></table>
<%
try {
CircleOfTrustManager cotManager = new CircleOfTrustManager();
Set members = cotManager.getAllCirclesOfTrust("/");
if ((members == null) || members.isEmpty()) {
out.print("Misconfiguration - No circle of trust for root realm.");
} else {
out.print(members.toArray()[0]);
}
} catch (Exception e) {
out.print(e.toString());
}
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblBot" title="">
<tbody><tr>
<td class="MstTdTtl" width="99%">
<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>
<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, Inc." align="right" border="0" height="10" width="108" /></td></tr></tbody></table></div><div class="SkpMedGry1"><a name="SkipAnchor2089" id="SkipAnchor2089"></a></div>
<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>
<p><br>
<table border="0" width="700">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<hr>
<form method=get name="fedletXACMLQuery" action=fedletXACMLResp.jsp onsubmit="return checkEmptyResource();">
<h1> XACML Query </h1>
<%
String idpEntityID = request.getParameter("idpEntityID");
String spEntityID = request.getParameter("spEntityID");
String nameIDValue = request.getParameter("nameIDValue");
String newNameIDValue = URLEncDec.encode(nameIDValue);
%>
<p>
<input type=hidden name=idpEntityID value="<%=idpEntityID%>">
<input type=hidden name=spEntityID value="<%=spEntityID%>">
<input type=hidden name=nameIDValue value="<%=newNameIDValue%>">
<h3>Resource URL</h3>
<input type=text name=resource value=<%=request.getRequestURL()%> size=120> <br>
<p> <p>
<h3>Action</h3>
<input type="radio" name="action" value="GET" checked/> GET <br>
<input type="radio" name="action" value="POST"/> POST <br>
<input type=submit>
</form>
<hr>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</body>
</html>