Tag Archives: java

Install CAS Client in a Java Application Server

6 Sep

Download CAS Client

Configure web.xml

  • Configure filter elements. Has to be the first filter in the web.xml file
<filter>
                <filter-name>CAS Authentication Filter</filter-name>
                <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
                <init-param>
                        <param-name>casServerLoginUrl</param-name>
                        <param-value>https://sso.mydomain.org:8443/cas-server-webapp-3.4.7/login</param-value>                 </init-param>
                <init-param>
                        <param-name>serverName</param-name>
                        <param-value>http://www.abc.org</param-value>                 </init-param>
                <init-param>
                        <param-name>renew</param-name>
                        <param-value>false</param-value>
                </init-param>
                <init-param>
                        <param-name>gateway</param-name>
                        <param-value>false</param-value>
                </init-param>
</filter>
<filter>
                <filter-name>CAS Validation Filter</filter-name>
                <filter-class>org.jasig.cas.client.validation.Cas10TicketValidationFilter</filter-class>
                <init-param>
                        <param-name>casServerUrlPrefix</param-name>
                        <param-value>http://sso.mydomain.org:8080/cas-server-webapp-3.4.7/</param-value>                 </init-param>
                <init-param>
                        <param-name>serverName</param-name>
                        <param-value>http://www.abc.org</param-value>                 </init-param>
<!--
<init-param>
<param-name>hostnameVerifier</param-name>
<param-value>org.jasig.cas.client.ssl.AnyHostnameVerifier</param-value>
</init-param>
-->
</filter>

<filter-mapping>
                <filter-name>CAS Authentication Filter</filter-name>
                <url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>

                <filter-name>CAS Validation Filter</filter-name>
                <url-pattern>/*</url-pattern>
</filter-mapping>