Introduction: This document describes the steps of authenticating Helical Insight application using Central Authentication Service (CAS).
Prerequisite :
- Java version 1.7 or higher
- Apache tomcat 7.0 +
- Helical Insight Application Version 2.0 +
Below are the steps :
- Configurations needs to do on CAS server :
- Download 4.0.1 or higher version of Jasig CAS. (It will be a zip file)
- Extract the zip file.
- You will find “cas.war” file inside the extracted folder.
- Place this “cas.war” file inside “apache-tomcat/webapps” folder. Once the tomcat is restarted you will find cas folder at the same locaton.
- Try to access the cas using “ServerIP:TomcatPort/cas/login”
For example : “localhost:8080/cas/login”
- Default credentials for logging into the cas are as belows:
UserName : casuser
Password : Mellon
Once the login is successful, you are able to see below screen:
- For creating new users inside cas, follow below steps :
-
- Edit the “deployerConfigContext.xml” file located at “apache-tomcat/webapps/cas/WEB-INF”
- You will find property tag with name=”users” (as shown below) contains the information of Users:
- You can add the new user entry by providing key and value.
<property name="users"> <map> <entry key="casuser" value="Mellon"/> </map> </property>
Example:
<property name="users"> <map> <entry key="casuser" value="Mellon"/> <entry key="helicaluser" value="helical"/> </map> </property>
Above, we have added new user entry with UserName = helicaluser and Password = helical.
- Configurations for Helical Insight application server :
- Open “spring-security.xml” file in a text editor. ( “spring-security.xml” file will be located at “WEB-INF/classes/” folder).
- Modify the URLs present in the below lines of code as per your configuration of CAS server.
<beans:bean id="casEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint"> <beans:property name="loginUrl" value="http://192.168.2.184:8080/cas/login"/> <beans:property name="serviceProperties" ref="serviceProperties"/> </beans:bean> <beans:property name="ticketValidator"> <beans:bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"> <beans:constructor-arg index="0" value="http://192.168.2.184:8080/cas"/> </beans:bean> </beans:property>
- Comment out the “entry-point-ref=”loginUrlAuthenticationEntryPoint”” and uncomment “”entry-point-ref=”casEntryPoint”” from “spring-security.xml” file, as shown below.
<http access-denied-page="/WEB-INF/jsp/errorPages/accessdenied.jsp" use-expressions="true" auto-config="false" entry-point-ref="casEntryPoint"> <!--entry-point-ref="loginUrlAuthenticationEntryPoint"--> <!--entry-point-ref="loginUrlAuthenticationEntryPoint"(use this when no cas)--> <!--entry-point-ref="casEntryPoint"(to enable cas)-->
- After making above changes (as mentioned in step 2 & 3) save the “spring-security.xml” file and close it.
- Open “application-context.xml” file in a text editor. ( “application-context.xml” file will be located at “WEB-INF/classes/” folder).
- Configure the below lines of code as per your Helical Insight application details.
<bean class="org.springframework.security.cas.ServiceProperties" id="serviceProperties"> <property name="service" value="http://{your-ip}:{your-port}/{context}/j_spring_cas_security_check"/> <property name="sendRenew" value="false"/> </bean>
Example :
<bean class="org.springframework.security.cas.ServiceProperties" id="serviceProperties"> <property name="service" value="http://localhost:8085/hi-ee/j_spring_cas_security_check"/> <property name="sendRenew" value="false"/> </bean>
- Save the changes and close the file.
- Restart your Helical Insight application server.
- Once the server is started, Try to access your application URL
Example : “http://localhost:8085/hi-ee/hi.html”
- This will redirect your application to the login page of CAS.
- Once you provide the valid credentials of UserName and Password for CAS server. Helical Insight application will create the session for that user by using the credentials of CAS.
-