CAS Central Authentication Service


Deploy Sample Application (using java client)

Setting up server

1. Downlaod CAS Server zip from "http://www.ja-sig.org/products/cas/downloads/index.html".

2. Extract the zip file.

3. Download Apache Tomcat 5.23.

4. Copy "cas-server-webapp-3.3.war" from "\cas-server-3.3\modules" folder and paste it in "<<apache-tomcat-home>>\webapps" folder.

5. Open "<<apache-tomcat-home>>\conf\server.xml" and uncomment below line.

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" />

6. Start server.

7. Open browser and type "https://localhost:8443/cas/login". A login form will be displayed.


 

Configuring Client

1. Downlaod "Yale CAS Client" zip from "http://www.ja-sig.org/products/cas/downloads/index.html".

2. Extract the zip file.

3. Create your webapplications

4. Add extracted cas-client.jar to you web application path.

5. In the web.xml of your web application add below 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://secure.its.yale.edu/cas/login</param-value>
</init-param>
<init-param>
<param-name>edu.yale.its.tp.cas.client.filter.validateUrl</param-name>
<param-value>https://secure.its.yale.edu/cas/serviceValidate</param-value>
</init-param>
<init-param>
<param-name>edu.yale.its.tp.cas.client.filter.serverName</param-name>
<param-value>your server name and port (e.g., www.yale.edu:8080)</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CAS Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

6. Now create two Jsp pages to test - page1.jsp and page2.jsp

7. In both of the pages add the following lines at the top
<%@ taglib uri="http://www.yale.edu/its/tp/cas/version2" prefix="cas"%>
<cas:auth var="netID" scope="session">
<cas:loginUrl>https://secure.its.yale.edu/cas/login</cas:loginUrl>
<cas:validateUrl>https://secure.its.yale.edu/cas/proxyValidate</cas:validateUrl>
<cas:authorizedProxy>https://authorized-proxy1</cas:authorizedProxy>
<cas:authorizedProxy>https://authorized-proxy2</cas:authorizedProxy>
<cas:service>http://service-url</cas:service> </cas:auth>
<html>
<body>
<p>Welcome, <%= session.getAttribute("netID"); %>!</p>
</body>
</html>

 


Run example

1. Now type "https://localhost:8443/cas/login?service=<<jsp page1 path>> in the address bar of the browser.

2. A login form will be displayed where you need to enter credentials. For testing, enter same username and password i.e., username: jusfortechies and password: jusfortechies.

3. You will be successfully logged in and navigated to <<jsp page1 path>> with a welcome message.

4. Now type <<jsp page2 path>> in the address bar of the browser. You will be automatically logged in and a welcome message will be displayed.

 

 

<<Previous page Next page>>


blog comments powered by Disqus