index.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
851N/A<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
287N/A<%@ page import="com.sun.identity.saml2.jaxb.metadata.IDPSSODescriptorElement" %>
911N/A<%@ page import="com.sun.identity.saml2.jaxb.metadata.SPSSODescriptorElement" %>
911N/A<%@ page import="com.sun.identity.saml2.jaxb.metadata.AssertionConsumerServiceElement" %>
911N/A<%@ page import="com.sun.identity.saml2.jaxb.metadata.SingleSignOnServiceElement" %>
911N/A<%@ page import="com.sun.identity.saml2.meta.SAML2MetaException" %>
287N/A<%@ page import="com.sun.identity.saml2.meta.SAML2MetaManager" %>
493N/A<%@ page import="java.io.IOException" %>
287N/A<%@ page import="java.io.File" %>
287N/A<%@ page import="java.io.InputStream" %>
287N/A<%@ page import="java.io.FileOutputStream" %>
287N/A<%@ page import="java.util.ArrayList" %>
287N/A<%@ page import="java.util.Iterator" %>
287N/A<%@ page import="java.util.List" %>
287N/A<%@ page import="java.util.Map" %>
287N/A<%@ page import="java.util.HashMap" %>
287N/A<%@ include file="header.jspf" %>
287N/A String deployuri = request.getRequestURI();
287N/A int slashLoc = deployuri.indexOf("/", 1);
287N/A deployuri = deployuri.substring(0, slashLoc);
if ((fedletHomeDir == null) || (fedletHomeDir.trim().length() == 0)) {
fedletHomeDir = File.separator + "fedlet";
File.separator + "fedlet";
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<div class="MstDiv"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="MstTblTop" title="">
<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>
String param = request.getParameter("CreateConfig");
if ((param != null) && param.equalsIgnoreCase("true")) {
"idp.xml",
"sp.xml",
"fedlet.cot"};
if (!dir.exists()) {
if (!dir.mkdirs()) {
} else if (dir.isFile()) {
for (int i = 0; i < files.length; i++) {
src = servletCtx.getResourceAsStream(source);
while ((length = src.read(bytes)) != -1) {
fos.write(bytes, 0, length);
" could not be found in fedlet.war");
throw new SAML2Exception(e.getMessage());
fos.close();
src.close();
out.println("<p><br><b>Fedlet configuration created under \"" +
getResourceAsStream("/conf/FederationConfig.properties");
File file = new File(fedletHomeDir + File.separator +
out.println("<p><br><b>Fedlet configuration home directory does not exist.</b>");
out.println("<br><br>Click <a href=\"index.jsp?CreateConfig=true\">here</a> to create Fedlet configuration automatically.");
out.println("<br>Or manually extract your fedlet.war and copy all files under \"conf\" directory to \"" + fedletHomeDir + "\" directory, then restart your web container.");
out.println("<br>Please follow the README bundled inside your Fedlet-unconfigured.zip file to setup Fedlet configuration, then restart your web container.");
} else if (!file.exists()) {
out.println("<br><br>Click <a href=\"index.jsp?CreateConfig=true\">here</a> to create Fedlet configuration automatically.");
out.println("<br>Or manually extract your fedlet.war and copy all files under \"conf\" directory to \"" + fedletHomeDir + "\" directory, then restart your web container.");
out.println("<br>Please follow the README bundled inside your Fedlet-unconfigured.zip file to setup Fedlet configuration, then restart your web container.");
if ((spEntities != null) && !spEntities.isEmpty()) {
spEntityID = (String) spEntities.get(0);
if ((spMetaAliases != null) && !spMetaAliases.isEmpty()) {
spMetaAlias = (String) spMetaAliases.get(0);
idpEntityID = request.getParameter("idpEntityID");
if ((idpEntityID == null) || (idpEntityID.length() == 0)) {
if ((idpEntities != null) && !idpEntities.isEmpty()) {
int numOfIDP = idpEntities.size();
String idpID = (String) idpEntities.get(j);
if (manager.isTrustedProvider("/",
trustedIDPs.add(idpID);
if (trustedIDPs.size() > 1) {
int numOfIDP = trustedIDPs.size();
out.println("<p><br><b>Multiple Identity Providers are configured with this Fedlet.</b><br>");
out.println("<br><b>Please select the Identity Provider to validate the Fedlet setup :</b><br>");
String thisURI = request.getRequestURI();
if (thisURI.indexOf("?") != -1) {
idpEntityID = (String) trustedIDPs.get(j);
out.println("<br><a href=\"" + thisURI + "idpEntityID="
out.println("<br><br><b>or </b><br>");
out.println("<a href=\"" + deployuri +
"/saml2/jsp/fedletSSOInit.jsp?metaAlias=" + spMetaAlias
out.println("</body>");
out.println("</html>");
} else if (!trustedIDPs.isEmpty()) {
idpEntityID = (String) trustedIDPs.get(0);
out.println("<p><br><b>Fedlet or remote Identity Provider metadata is not configured.</b>");
out.println("<p><br>Click <a href=\"index.jsp?CreateConfig=true\">here</a> to create Fedlet configuration automatically.");
out.println("<br>Or manually extract your fedlet.war and copy all files under \"conf\" directory to \"" + fedletHomeDir + "\" directory, then restart your web container.");
out.println("<br>Please follow the README bundled inside your Fedlet-unconfigured.zip file to setup Fedlet configuration, then restart your web container.");
String idpBaseUrl = (String)idpMap.get("idpBaseUrl");
idpMetaAlias = (String)idpMap.get("idpMetaAlias");
Click following links to start Fedlet(SP) and/or IDP initiated
<td colspan="2"><a href="<%= fedletBaseUrl %>/saml2/jsp/fedletSSOInit.jsp?metaAlias=<%= spMetaAlias %>&idpEntityID=<%= idpEntityID%>&binding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">Run Fedlet (SP) initiated Single Sign-On using HTTP POST binding</a></td>
<td colspan="2"><a href="<%= fedletBaseUrl %>/saml2/jsp/fedletSSOInit.jsp?metaAlias=<%= spMetaAlias %>&idpEntityID=<%= idpEntityID %>&binding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact">Run Fedlet (SP) initiated Single Sign-On using HTTP Artifact binding</a></td>
if ((idpMetaAlias != null) && (idpMetaAlias.length() != 0)){
<td colspan="2"><a href="<%= idpBaseUrl %>/idpssoinit?NameIDFormat=urn:oasis:names:tc:SAML:2.0:nameid-format:transient&metaAlias=<%= idpMetaAlias %>&spEntityID=<%=spEntityID %>&binding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">Run Identity Provider initiated Single Sign-On using HTTP POST binding</a></td>
<td colspan="2"><a href="<%= idpBaseUrl %>/idpssoinit?NameIDFormat=urn:oasis:names:tc:SAML:2.0:nameid-format:transient&metaAlias=<%= idpMetaAlias %>&spEntityID=<%=spEntityID %>&binding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact">Run Identity Provider initiated Single Sign-On using HTTP Artifact binding</a></td>