Users looking for a CAS Client for Java should be using the CAS Client for Java 3.1

Configure the CAS Client for Standalone Applications

Add the Dependencies

To configure the JA-SIG CAS Client for Java, the first thing you need to do is gather the dependencies. If your project is using Maven2, you can include the client by adding the following to your pom.xml:

uPortal Integration Support

The JA-SIG CAS Client for Java provides out the box support for the uPortal 2.x framework.

Gotchas and alternatives

uPortal in recent releases (later 2.5.x releases and all 2.6 releases) provides out of the box CAS integration support, including example configuration, all necessary libraries, and integration APIs, by means of the Yale Java CAS Client. You do not need to use the JA-SIG Java CAS Client or to follow these instructions to achieve basic CAS integration in uPortal. See instead the uPortal Manual page on this topic, which exists with the purpose of making this as simple and as un-frustrating as possible for you, the uPortal deployer. (It's even named "for the impatient"!)

What is documented here is an alternative to the default approach. However, this alternative will only work with version 3.0.x of the JA-SIG Java CAS Client. It will not work with version 3.1 of the JA-SIG Java CAS Client, in which this uPortal-specific integration code was removed for various reasons. (It's not clear that uPortal-specific code belongs here, and this integration code did not make use of the CAS integration APIs shipping in uPortal, instead introducing new APIs, and so it did not transparently integrate with e.g. the CasConnecionContext shipping with uPortal 2.6).

In short, you're entirely welcome to this this JA-SIG Java CAS Client version 3.0.x and these instructions to accomplish your uPortal-CAS integration, but if you do, you're doing something different than the CAS integration that most uPortal-CAS-integrators are doing.

Add the Dependencies

To configure the JA-SIG CAS Client for Java, the first thing you need to do is gather the dependencies. If your project is using Maven2, you can include the client by adding the following to your pom.xml:

Configure the uPortal Spring Bean Factory

You'll need to add the CAS Spring Bean Factory to the uPortal Spring Bean Factory so it can find it. Modify the properties/beanRefFactory.xml to include the file you created above containing the Spring Beans that the CAS client needs.

Accessing the URL:

Removing service tickets from URLs after validation:

After users have logged into CAS and access a protected service/resource, they are redirected back to the requested service/resource with a CAS service ticket. The CAS client uses this ticket to determine whether the user has been authenticated by CAS and request the user's username. However, the service ticket is still on the query string for the request service. This is a problem whenever the user attempts to refresh the page or return to the page after a later time because the ticket is no longer valid!

In order for this service ticket to be removed from the URL of the requested service/resource, an alternative configuration of the TicketValidationFilter bean must be used.

Before someone goes and attempts to use the above instruction for a new app, here is an important warning.

As of CAS Client 3.1, the above documentation is out of date, as package names have changed and Spring as well as Spring config. I will try to post a working example later on that can be used to replace this topic.