Steps of Configure LDAP Server
www.liferay.com/web/nidhi.singh/blog/-/blogs/liferay-integration-with-ldap
Steps for SSL Certificate
Open Command Prompt and type given below command
keytool -genkey -alias tomcat -keypass changeit -keyalg RSA
Enter keystore password: changeit
What is your first and last name?
[Unknown]: localhost
What is the name of your organizational unit?
[Unknown]: Information Systems
What is the name of your organization?
[Unknown]: Life
What is the name of your City or Locality?
[Unknown]: Bangalore
What is the name of your State or Province?
[Unknown]: KA
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=localhost, OU=Information Systems, O=Life, L=Bangalore, ST=KA, C=IN correct?
[no]: yes
keytool -export -alias tomcat -keypass changeit -file E:\server.crt
Enter keystore password: changeit
Certificate stored in file E:\<server.crt>
keytool -import -file E:\server.crt -keypass changeit -keystore ..\jre\lib\security\cacerts
Enter keystore password: changeit
Owner: CN=localhost, OU=Information Systems, O=Life, L=Bangalore, ST=KA, C=IN
Issuer: CN=localhost, OU=Information Systems, O=Life, L=Bangalore, ST=KA, C=IN
Serial number: 462030d8
Valid from: Fri Apr 13 15:39:36 HST 2010 until: Thu Jul 12 15:39:36 HST 2010
Certificate fingerprints:
MD5: CC:3B:FB:FB:AE:12:AD:FB:3E:D 5:98:CB:2E:3B:0A:AD
SHA1: A1:16:80:68:39:C7:58:EA:2F:48:59:AA:1D:73:5F:56:78:CE:A4:CE
Trust this certificate? [no]: yes
Certificate was added to keystore
Steps for ApacheTomcat Server
Remove comments from server.xml file for HTTPS request which runs on port no 8443.
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="C:/Documents and Settings/nidhi.singh/.keystore" keystorePass="changeit" truststoreFile="C:/Program Files/Java/jdk1.6.0_18/jre/lib/security/cacerts" />
Setting up CAS server
1. Download the CAS Server and find the war file e.g. \cas-server-3.2.1\modules\cas-server-webapp-3.2.1.war
2. Start the Apache Tomcat server. Deploy the war file (cas-server-webapp-3.2.1.war) to the Tomcat’s webapps folder and rename it. e.g. C:\apache-tomcat-6.0.14\webapps\cas-web
3. Now that CAS is deployed you should have an unpacked directory in your webapps folder e.g. C:\apache-tomcat-6.0.14\webapps\cas-web
4. Stop the tomcat server
5. Add the below lines to the pom.xml file in the META-INF folder (e.g. C:\apache-tomcat-6.0.14\webapps\cas-web\META-INF\maven\org.jasig.cas\cas-server-webapp)
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cas-server-support-ldap</artifactId>
<version>${project.version}</version>
</dependency>
6. Add the following to the deployerConfigContext.xml file in the WEB-INF directory e.g. C:\apache-tomcat-6.0.14\webapps\cas-web\WEB-INF (Connects to the default Apache Directory Server configuration)
<bean id="contextSource" class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource">
<property name="pooled" value="true"/>
<property name="urls">
<list>
<value>ldap://localhost:10389</value>
</list>
</property>
<property name="userName" value="uid=admin,ou=system"/>
<property name="password" value="secret"/>
<property name="baseEnvironmentProperties">
<map>
<entry>
<key>
<value>java.naming.security.authentication</value>
</key>
<value>simple</value>
</entry>
</map>
</property>
</bean>
7. Add the corresponding AuthenticationHandler to the deployerConfigContext.xml file (Remove the SimpleAuthenticationHandler) and Add the following in it's place.
<bean class="org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler" >
<property name="filter" value="cn=%u,dc=example,dc=com" />
<property name="contextSource" ref="contextSource" />
</bean>
8. Add the cas-server-support-ldap-3.2.1.jar from the CAS installation \cas-server-3.2.1\modules to the web application library e.g( C:\apache-tomcat-6.0.14\webapps\cas-web\WEB-INF\lib)
9. Start tomcat and log in with the username and password at the url https://localhost:8443/cas-web/login
Setting up Liferay
1. Create system-ext.properties (webapps\ROOT\WEB_INF\classes)
com.liferay.filters.sso.cas.CASFilter=true
3. Open portal-ext.properties and enter and Save it.
auto.login.hooks=com.liferay.portal.security.auth.BasicAutoLogin
auto.login.hooks=com.liferay.portal.security.auth.BasicAutoLogin,com.liferay.portal.security.auth.CASAutoLogin
4. Login as administrator and go to control panel->settings->Authentication->CAS
5. Check Enable checkbox and Import from LDAP.
6. Give Login URL: https://localhost:8443/cas-web/login
7. Give Logout URL: https://localhost:8443/cas-web/logout
8. Give Server Name: localhost:8080
9. Give Service URL: http://localhost:8080/c/portal/login
10. Give Validate URL: https://localhost:8443/cas-web/proxyValidate
11. Save it


