working HS?
authorblk <blk@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 Jun 2002 21:52:11 +0000 (21:52 +0000)
committerblk <blk@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 Jun 2002 21:52:11 +0000 (21:52 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@92 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/hs/ClubShibSQLHandleRepository.java
src/edu/internet2/middleware/shibboleth/hs/HandleServiceSAML.java
src/edu/internet2/middleware/shibboleth/hs/HandleServlet.java
webAppConfig/origin.xml

index 29c2e15..039a7ae 100755 (executable)
@@ -98,7 +98,7 @@ public class ClubShibSQLHandleRepository extends HandleRepositoryFactory{
            st.close();
         }
         catch (SQLException e) {
            st.close();
         }
         catch (SQLException e) {
-           throw new HandleException(HandleException.SQL, e.getMessage());
+           throw new HandleException(e.getMessage());
         }
     }
 
         }
     }
 
index d129070..0ba9f0e 100755 (executable)
@@ -18,16 +18,16 @@ public class HandleServiceSAML {
     X509Certificate cert;
 
     public HandleServiceSAML( String domain, String AAurl, String HSname,
     X509Certificate cert;
 
     public HandleServiceSAML( String domain, String AAurl, String HSname,
-                             String KSpath, String KSpass, String KSkeyalias,
-                             String KSkeypass, String certalias ) 
-       throws SAMLException, KeyStoreException, IOException, FileNotFoundException, Exception
+                             String KSpass, String KSkeyalias,
+                             String KSkeypass, String certalias, 
+                             InputStream is ) 
+       throws SAMLException, KeyStoreException, IOException, Exception
     {
        this.domain = domain;
        this.AAurl = AAurl;
        
        KeyStore ks = KeyStore.getInstance("JKS");
     {
        this.domain = domain;
        this.AAurl = AAurl;
        
        KeyStore ks = KeyStore.getInstance("JKS");
-       FileInputStream fis = new FileInputStream(KSpath);
-       ks.load( fis, KSpass.toCharArray());
+       ks.load( is, KSpass.toCharArray());
        privateKey = (PrivateKey)ks.getKey(KSkeyalias, KSkeypass.toCharArray());
        cert =(X509Certificate)ks.getCertificate(certalias);
        
        privateKey = (PrivateKey)ks.getKey(KSkeyalias, KSkeypass.toCharArray());
        cert =(X509Certificate)ks.getCertificate(certalias);
        
index cbf51e1..46a20d8 100644 (file)
@@ -22,14 +22,17 @@ public class HandleServlet extends HttpServlet {
        getInitParams();
 
        try {
        getInitParams();
 
        try {
+           InputStream is = getServletContext().getResourceAsStream
+               (getInitParameter("KSpath"));
            hsSAML = new HandleServiceSAML( getInitParameter("domain"), 
                                            getInitParameter("AAurl"),
                                            getInitParameter("HSname"),
            hsSAML = new HandleServiceSAML( getInitParameter("domain"), 
                                            getInitParameter("AAurl"),
                                            getInitParameter("HSname"),
-                                           getInitParameter("KSpath"),
                                            getInitParameter("KSpass"),
                                            getInitParameter("KSkeyalias"),
                                            getInitParameter("KSkeypass"),
                                            getInitParameter("KSpass"),
                                            getInitParameter("KSkeyalias"),
                                            getInitParameter("KSkeypass"),
-                                           getInitParameter("certalias") );
+                                           getInitParameter("certalias"),
+                                           is );
+           
            hrf = HandleRepositoryFactory.getInstance
                ( Constants.POLICY_CLUBSHIB, this );
        }
            hrf = HandleRepositoryFactory.getInstance
                ( Constants.POLICY_CLUBSHIB, this );
        }
@@ -133,7 +136,7 @@ public class HandleServlet extends HttpServlet {
        throws HandleException {
        try {
 
        throws HandleException {
        try {
 
-           res.setContentType("text/html");
+           /*   res.setContentType("text/html");
            PrintWriter out = res.getWriter();
            out.println("<HTML><HEAD><TITLE>Handle Service</TITLE></HEAD>");
            out.println("<BODY onLoad=\"document.forms[0].submit()\">");
            PrintWriter out = res.getWriter();
            out.println("<HTML><HEAD><TITLE>Handle Service</TITLE></HEAD>");
            out.println("<BODY onLoad=\"document.forms[0].submit()\">");
@@ -145,26 +148,26 @@ public class HandleServlet extends HttpServlet {
                        "value=\"" + buf + "\">");
            out.println("<input type=\"submit\" value=\"Transmit\">");
            out.println("</form>");
                        "value=\"" + buf + "\">");
            out.println("<input type=\"submit\" value=\"Transmit\">");
            out.println("</form>");
-           
+           */
            /**
             * uncomment the following to implement 
             * forwarding to hs.jsp for submission
            /**
             * uncomment the following to implement 
             * forwarding to hs.jsp for submission
-             * 
+             */
            //Hardcoded to ASCII to ensure Base64 encoding compatibility
            req.setAttribute("assertion", new String(buf, "ASCII"));
            RequestDispatcher rd = req.getRequestDispatcher("/hs.jsp");
            rd.forward(req, res);
            //Hardcoded to ASCII to ensure Base64 encoding compatibility
            req.setAttribute("assertion", new String(buf, "ASCII"));
            RequestDispatcher rd = req.getRequestDispatcher("/hs.jsp");
            rd.forward(req, res);
-           */
+           
        } catch (IOException ex) {
            throw new HandleException
                ("IO interruption while displaying Handle Service UI." + ex);
        } 
        } catch (IOException ex) {
            throw new HandleException
                ("IO interruption while displaying Handle Service UI." + ex);
        } 
-       /*
+       
          catch (ServletException ex) {
            throw new HandleException
                ("Problem displaying Handle Service UI." + ex);
        }
          catch (ServletException ex) {
            throw new HandleException
                ("Problem displaying Handle Service UI." + ex);
        }
-       */
+
     }
 
     private void handleError( HttpServletRequest req, 
     }
 
     private void handleError( HttpServletRequest req, 
index 803a830..6ddc46f 100755 (executable)
                        <param-value>org.gjt.mm.mysql.Driver</param-value>
                </init-param>
                <init-param>
                        <param-value>org.gjt.mm.mysql.Driver</param-value>
                </init-param>
                <init-param>
-                       <param-name>DBdriver</param-name>
-                       <param-value>org.gjt.mm.mysql.Driver</param-value>
-               </init-param>
-               <init-param>
                        <param-name>DBuser</param-name>
                        <param-value>shib</param-value>
                </init-param>
                        <param-name>DBuser</param-name>
                        <param-value>shib</param-value>
                </init-param>
@@ -47,7 +43,7 @@
                </init-param>
                <init-param>
                        <param-name>KSpath</param-name>
                </init-param>
                <init-param>
                        <param-name>KSpath</param-name>
-                       <param-value>/home/blk/.keystore</param-value>
+                       <param-value>/WEB-INF/conf/keystore.dks</param-value>
                </init-param>
                <init-param>
                        <param-name>KSpass</param-name>
                </init-param>
                <init-param>
                        <param-name>KSpass</param-name>