5 Replies Latest reply on Jun 11, 2012 8:28 AM by Ravikumar S

    CAS integration ESB

    Robert Kozura Newbie

      Hello everyone,

       

      I wanted to know if it is possible to integrate CAS into the ESB.  Does the ESB support Spring Security on REST web services?

       

      Here is the CAS page on getting CAS filters working for Spring:

      https://wiki.jasig.org/display/CASC/Configuring+the+JA-SIG+CAS+Client+for+Java+using+Spring

       

      Has anyone done this?  Any pointers?  Help?

        • 1. Re: CAS integration ESB
          Claus Ibsen Master

          You can deploy WAR files in the ESB.

          http://fusesource.com/docs/esb/4.3/esb_deploy_osgi/UrlHandlers-War.html

           

          So you should be able to do the CAS stuff using a web application.

          • 2. Re: CAS integration ESB
            Robert Kozura Newbie

            Thank you for your response.

             

            I have tried to import CAS-ified WAR files before, but it seems the newly created OSGi bundle is not looking in the WEB-INF folder to get the web.xml file.

             

            The web.xml file is where I defined the CAS filter for CAS login redirection.  This setup works on Tomcat, but not on the ESB.

             

            Is there any way to CASify OSGi bundles using Spring?  Or any way to get the WAR file's web.xml functioning?

             

             

            Thanks.

            • 3. Re: CAS integration ESB
              Claus Ibsen Master

              Why not try deploying the WAR file which worked in Apache Tomcat, in Fuse ESB?

              • 4. Re: CAS integration ESB
                Robert Kozura Newbie

                Got it working.  Here is the complete breakdown to get CASified WAR files to function properly on the ESB:

                 

                This is for FUSE ESB 4.3

                 

                From the Servicemix command line:

                 

                install war:file:///C:/apps.war?Webapp-Context=apps

                 

                osgi:start

                 

                How to enable SSL on the ESB (CAS needs SSL):

                 

                Create org.ops4j.pax.web.cfg in \etc with the following values:

                 

                org.osgi.service.http.secure.enabled=true

                org.ops4j.pax.web.ssl.keystore=D:/KEYSTORE/keystore.jks

                org.ops4j.pax.web.ssl.password=changeit

                org.ops4j.pax.web.ssl.keypassword=changeit

                org.osgi.service.http.port.secure=8182

                 

                How to set JAVA_OPTS needed for CAS:

                 

                Edit servicemix.bat and add the following line:

                 

                rem add trustStore to java options

                set JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStore=D:\KEYSTORE\keystore.jks -Djavax.net.ssl.trustStorePassword=changeit

                 

                Make sure the CAS client jars are installing correctly.  I added the jars in the WEB-INF/lib directory of the WAR.

                 

                Here is my web.xml file as an example:

                 

                 

                 

                 

                It would be nice to CASify a RESTful OSGi endpoint instead of a WAR.  I noticed there is a beans.xml file, is this synonymous with the web.xml file?  Has anyone CASified a RESTful web service?

                • 5. Re: CAS integration ESB
                  Ravikumar S Newbie

                  Hi rkozura,

                   

                  Can you please guide me in setting up the CAS server in Fuse ESB Service Mix?

                  I followed the guidelines provided by you. But still I am failing somewhere. Not understanding. Your help is highly appreciated.

                   

                  How to access the CAS server login page after successful deployment? I am able to deploy successfully but will get the below error.

                   

                  HTTP: 500

                  Problem accessing /cas/login. Reason:

                  Context attribute is not of type WebApplicationContext: Root WebApplicationContext: startup date Mon Jun 11 14:05:18 IST 2012; root of context hierarchy

                   

                  Not getting the cause. Kindly help on the same.

                   

                  Thanks,

                  Ravi