Added override for SHIRE location.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 18 Jul 2002 14:59:56 +0000 (14:59 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 18 Jul 2002 14:59:56 +0000 (14:59 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@222 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/shire/ShireServlet.java

index da64243..185025c 100755 (executable)
@@ -69,6 +69,7 @@ import org.opensaml.*;
  */
 public class ShireServlet extends HttpServlet
 {
+    private String shireLocation = null;
     private String cookieName = null;
     private String sessionDir = null;
     private boolean sslOnly = true;
@@ -96,6 +97,8 @@ public class ShireServlet extends HttpServlet
      *
      *
      *  <DL>
+     *    <DT> shire-location <I>(optional)</I> </DT>
+     *    <DD> The URL of the SHIRE if not derivable from requests</DD>
      *    <DT> keystore-path <I>(required)</I> </DT>
      *    <DD> A pathname to the trusted CA roots to accept</DD>
      *    <DT> keystore-password <I>(required)</I> </DT>
@@ -128,6 +131,8 @@ public class ShireServlet extends HttpServlet
 
         ServletConfig conf = getServletConfig();
 
+        shireLocation = conf.getInitParameter("shire-location");
+
         cookieName = conf.getInitParameter("cookie-name");
         if (cookieName == null)
             throw new ServletException("ShireServlet.init() missing init parameter: cookie-name");
@@ -245,7 +250,9 @@ public class ShireServlet extends HttpServlet
             // Get a profile object using our specifics.
             String[] policies = {Constants.POLICY_CLUBSHIB};
             ShibPOSTProfile profile =
-                ShibPOSTProfileFactory.getInstance(policies, mapper, HttpUtils.getRequestURL(request).toString(), 300);
+                ShibPOSTProfileFactory.getInstance(policies, mapper,
+                    (shireLocation!=null) ? shireLocation : HttpUtils.getRequestURL(request).toString(),
+                    300);
 
             // Try and accept the response...
             SAMLResponse r = profile.accept(responseData.getBytes());
@@ -315,7 +322,7 @@ public class ShireServlet extends HttpServlet
             fout.println("PBinding0=" + bindings[0].getBinding());
             fout.println("LBinding0=" + bindings[0].getLocation());
             fout.println("Time=" + System.currentTimeMillis()/1000);
-           fout.println("ClientAddress=" + request.getRemoteAddr());
+            fout.println("ClientAddress=" + request.getRemoteAddr());
             fout.println("EOF");
             fout.close();