Ideas behind CAS
Server
Example configuration
This configuration example uses the directory sample data and configuration from the Basic User's Guide.
SSL
deployerConfigContext.xml
... <bean id="authenticationManager" class="org.jasig.cas.authentication.AuthenticationManagerImpl"> ... <property name="authenticationHandlers"> <list> <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" /> <bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler" > <property name="filter" value="uid=%u" /> <property name="searchBase" value="ou=people,o=sevenSeas" /> <property name="contextSource" ref="contextSource" /> </bean> </list> </property> </bean> <bean id="contextSource" class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource"> <property name="urls"> <list> <value>ldap://zanzibar:10389</value> </list> </property> </bean> ...
Client
Simple example with Filters & JSP
required jars:
- casclient.jar (from Yale Java Client)
- JSTL (e.g. jstl-1.1.2.jar & standard-1.1.2.jar)
Deployment Descriptor:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>Simple CAS Client</display-name> <filter> <filter-name>CAS Filter</filter-name> <filter-class>edu.yale.its.tp.cas.client.filter.CASFilter</filter-class> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.loginUrl</param-name> <param-value>https://localhost/cas/login</param-value> </init-param> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.validateUrl</param-name> <param-value>https://localhost/cas/serviceValidate</param-value> </init-param> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.serverName</param-name> <param-value>localhost</param-value> </init-param> </filter> <filter-mapping> <filter-name>CAS Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
JSP:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <body> Welcome <c:out value="${sessionScope['edu.yale.its.tp.cas.client.filter.user']}"/>! </body> </html>