Build
git clone git@github.com:Jasig/java-cas-client.git cd java-cas-client mvn clean package
Please note that to be deployed in Maven Central, we mark a number of JARs as provided (related to JBoss and Memcache Clients). In order to build the clients, you must enable the commented out repositories in the appropriate pom.xml files in the modules
(cas-client-integration-jboss and cas-client-support-distributed-memcached) or follow the instructions on how to install the file manually.
Components
?
Core functionality, which includes CAS authentication/validation filters.
? Support for SAML functionality is provided by this dependency:
? Distributed proxy ticket caching with Ehcache is provided by this dependency:
? Distributed proxy ticket caching with Memcached is provided by this dependency:
? Atlassian integration is provided by this dependency:
? JBoss integration is provided by this dependency:
? Tomcat 6 integration is provided by this dependency:
? Tomcat 7 is provided by this dependency:
Configuration
Strategies
The client provides multiple strategies for the deployer to provide client settings. The following strategies are supported:
? ?
JNDI (JNDI)
Properties File (PROPERTY_FILE). The configuration is provided via an external properties file. The path may be specified in the web context as such:
If no location is specified, by default /etc/java-cas-client.properties will be used.
? ? ?
System Properties (SYSTEM_PROPERTIES) Web Context (WEB_XML) Default (DEFAULT)
In order to instruct the client to pick a strategy, strategy name must be specified in the web application's context:
If no configurationStrategy is defined, DEFAULT is used which is a combination of WEB_XML andJNDI.
Client Configuration Using web.xml
The client can be configured in web.xml via a series of context-params and filter init-params. Each filter for the client has a required (and optional) set of properties. The filters are designed to look for these properties in the following way:
? ? ?
Check the filter's local init-params for a parameter matching the required property name. Check the context-params for a parameter matching the required property name.
If two properties are found with the same name in the init-params and the context-params, theinit-param takes precedence.
Note: If you're using the serverName property, you should note well that the fragment-URI (the stuff after the #) is not sent to the server by all browsers, thus the CAS client can't capture it as part of the URL. An example application that is protected by the client is available here.
org.jasig.cas.client.authentication.AuthenticationFilter
The AuthenticationFilter is what detects whether a user needs to be authenticated or not. If a user needs to be authenticated, it will redirect the user to the CAS server.
Property Description
Defines the location of the CAS server login URL,
i.e. https://localhost:8443/cas/login
Required
casServerLoginUrl
Yes
serverName
The name of the server this application is hosted on. Service URL will be dynamically constructed using this, i.e.
Yes
https://localhost:8443 (you must include the protocol, but port is optional if it's a standard port).
The service URL to send to the CAS server,
No
i.e.https://localhost:8443/yourwebapp/index.html specifies whether renew=true should be sent to the CAS server. Valid values are eithertrue/false (or no value at all). Note No thatrenew cannot be specified as local init-paramsetting.
specifies whether gateway=true should be sent to the CAS server. Valid values are eithertrue/false (or no value at all)
No
service
renew
gateway
artifactParameterName
specifies the name of the request parameter on where to find the artifact No (i.e. ticket).
specifies the name of the request parameter
No
on where to find the service (i.e. service) Whether the client should auto encode the
No
service url. Defaults to true
Defines the url pattern to ignore, when intercepting authentication requests.
No
serviceParameterName
encodeServiceUrl
ignorePattern

