You are on page 1of 12

Integrating Liferay, Alfresco, SSO and LDAP

(Redirected from Full Integration - Liferay, Alfresco, SSO and LDAP) Tags: alfresco liferay portlet ldap sso integration Table of Contents [-]
y y y y y y

1 Integration of Alfresco (Web Client), SSO and LDAP 2 Integration of Alfresco (Share), SSO and LDAP 3 Integration of Liferay, SSO and LDAP 3.1 Remove CAS SSO settings in case 4 Integration of Liferay and Alfresco portlets 5 Integration of Liferay, Alfresco, SSO and LDAP

Integration of Alfresco (Web Client), SSO and LDAP


In ten steps, you could be able to integrate Alfresco with SSO and LDAP. It is simple for Do-ItYourselfers. Download URL: http://liferay.cignex.com/palm_tree/0387/sso/alfresco (Alfresco 3.1 E or above, SSO CAS 3.3 or above) Demo URL: http://liferay.cignex.com 1) Get Alfresco web client application: alfresco.war 2) Unzip it to $ALFRESCO_HOME (any folder in your local machine, e.g., new folder /Alfresco) 3) Copy sso-ldap-authentication-context.xml to $ALFRESCO_HOME/WEB-INF/classes. And copy ldap-authentication.properties and ldap-authentication-context.xml to $ALFRESCO_HOME/WEB-INF/classes/alfresco/extension Note that you can configure LDAP other than ldap:docs.cignex.com:10389 4) Copy bookpub-sso-ldap.jar to $ALFRESCO_HOME/WEB-INF/lib 5) Add following lines before the first <filter> in $ALFRESCO_HOME/WEB-INF/web.xml
<filter> <filter-name>CAS Filter</filter-name> <filter-class>com.bookpub.portal.servlet.filters.sso.cas.CASFilter</filterclass> <init-param> <param-name>cas_server_url</param-name>

<param-value>http://docs.cignex.com/cas-web</param-value> </init-param> <init-param> <param-name>service_path</param-name> <param-value>/index.jsp</param-value> </init-param> <init-param> <param-name>application_type</param-name> <param-value>Alfresco</param-value> </init-param> </filter>

Note that the SSO CAS should be installed with ports 80 and 443. Add following lines after the last </filter> in $ALFRESCO_HOME/WEB-INF/web.xml
<filter-mapping> <filter-name>CAS Filter</filter-name> <url-pattern>/index.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>CAS Filter</filter-name> <url-pattern>/logout</url-pattern> </filter-mapping>

And add following line after the line


<import resource="classpath:alfresco/web-services-application-context.xml" />

in $ALFRESCO_HOME/WEB-INF/web-application-context.xml. <import resource="classpath:sso-ldap-authentication-context.xml" /> 6) Add following lines after the first --%> in $ALFRESCO_HOME /jsp/parts/titlebar.jsp
<% String protocol = request.getProtocol(); protocol = protocol.substring( 0 , protocol.indexOf("/")).toLowerCase(); String address = request.getServerName(); String port = request.getServerPort() + ""; String path = request.getContextPath(); if(port.endsWith("443")) protocol += "s"; String currentURL = protocol + "://" + address + ":" + port + path + "/logout"; %>

And replace the line


<a:actionLink id="logout" image="/images/icons/logout.gif" value="#{msg.logout} (#{NavigationBean.currentUser.userName})" rendered="#{!NavigationBean.isGuest}" action="#{LoginBean.logout}" immediate="true" />

With the line


<a:actionLink id="logout" image="/images/icons/logout.gif" value="#{msg.logout} (#{NavigationBean.currentUser.userName})"

rendered="#{!NavigationBean.isGuest}" action="#{LoginBean.logout}" showLink="false" target="_parent" href="<%= currentURL %>" immediate="true" /> <a href="<%= currentURL %>" target="_parent"><h:outputText value="#{msg.logout} (#{NavigationBean.currentUser.userName})" /></a>

7) Update dir.root in $ALFRESCO_HOME/ WEB-INF/classes/alfresco/repository.propertes.


dir.root=../../alf_data

8) Copy mysql.jar to $ALFRESCO_HOME/WEB-INF/lib and Create a database alfresco in MySQL


drop database if exists alfresco; create database alfresco character set utf8; grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option; grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

9) Package all files as a WAR: alfresco.war; 10) Deploy it to $TOMCAT_DIR/webapps Or, you can use the result directly: download WAR from http://liferay.cignex.com/palm_tree/0387/sso/alfresco/alfresco.war and deploy it in $TOMCAT_DIR/webapps. Note that JAR is compliant with JDK 1.6 (1.6.0_14). This package has been tested in Tomcat (6.0.20) with following settings in setenv.bat (or setenv.sh). It is working fine!
JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx1024m -XX:MaxPermSize=256m Dfile.encoding=UTF8 -Duser.timezone=GMT Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Dcom.iplanet.am.cookie.c66Encode=true"

Integration of Alfresco (Share), SSO and LDAP


In five steps, you could be able to integrate Alfresco Share with SSO and LDAP. It is simple for Do-It-Yourselfers. Download URL: http://liferay.cignex.com/palm_tree/0387/sso/alfresco (Alfresco 3.1 E or above, SSO CAS 3.3 or above) Demo URL: http://liferay.cignex.com (Would be ready shortly ...)

Integration of Liferay, SSO and LDAP


In five steps, you could integrate Liferay with SSO and LDAP. It is simple for Do-ItYourselfers. Download URL: http://liferay.cignex.com/palm_tree/0387/sso/liferay (Liferay 5.2 or above, SSO CAS 3.3 or above) Demo URL: http://liferay.cignex.com 1) Download and Install cas-web.war Prepare Tomcat server $TOMCAT_HOME, and open port 8443 (for 8080; 443 for 80). in case (tomcat 6.0.18 or above, CAS 3.2 or below), change the code in $TOMCAT_HOME/webapps/cas-web/WEBINF/view/jsp/default/ui/casLoginView.jspcasLoingView.jsp from:
<c:set var="query" value="<%=request.getQueryString() == null ? "" : request.getQueryString().replaceAll( "&locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]|^locale=([A-Za-z][A-Za-z]_)?[AZa-z][A-Za-z]", "")%>" />

to:
<c:set var="query" value='<%=request.getQueryString() == null ? "" : request.getQueryString().replaceAll( "&locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]|^locale=([A-Za-z][A-Za-z]_)?[AZa-z][A-Za-z]", "")%>' />

Prepare certificate in Tomcat Server Drop cas-web.war to $TOMCAT_HOME/webapps Update LDAP URL (CAS 3.3 or above) in $TOMCAT_HOME/webapps/cas-web/WEBINF/deployerConfigContext.xml
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource"> <property name="pooled" value="true"/> <property name="urls"> <list> <value>ldap://docs.cignex.com:10389/</value> </list> </property> <property name="userDn" value="uid=admin,ou=system"/> <property name="password" value="yourpassword"/> <property name="baseEnvironmentProperties"> <map> <entry>

<key> <value>java.naming.security.authentication</value> </key> <value>simple</value> </entry> </map> </property> </bean>

Note that you can update LDAP other than ldap:docs.cignex.com:10389. And more, the SSO CAS server should be installed with ports 80 and 443. 2) Get Liferay Tomcat bundle and Install Liferay, you will have folder $TOMCAT_AS_DIR 3) Copy casclient.jar to $TOMCAT_AS_DIR /webapps/ROOT/WEB-INF/lib (replace old version) 4) Set up LDAP in Liferay (for LDAP test only ) Authenticated by screen name Search filter: (cn=@screen_name@) For Apache Directory, you can do following. For Active Directory, refer to http://www.liferay.com/web/guest/community/wiki//wiki/Main/Integration+with+NTLM+plus+ADS

5) Set up CAS SSO in Liferay Use virtual domain

Note that you would get message like This Connection is Un-trusted. You have asked Firefox to connect securely to docs.cignex.com, but we can't confirm that your connection is secure. Normally, when you try to connect securely, sites will present trusted identification to prove that you are going to the right place. However, this site's identity can't be verified. You should get or install certificate. In case, you should install SSL certificate in your own CAS server.

Remove CAS SSO settings in case


To remove CAS SSO (including other SSO like openSSO) settings, in case:
y y

shutdown the portal Run script:

delete from PortletPreferences where portletId = 'LIFERAY_PORTAL'; y

re-start the portal

Integration of Liferay and Alfresco portlets

In ten steps, you could be able to set alfresco web client as a set of portlets. It is simple for DoIt-Yourselfers. Download URL: http://liferay.cignex.com/palm_tree/0387/sso/liferay/alfresco-portlet (Liferay 5.2 or above, Alfresco 3.1 or above) Demo URL: http://liferay.cignex.com

1) Get Alfresco web client application: alfresco.war 2) Unzip it to $ALFRESCO_HOME (any folder in your local machine, e.g., new folder /Alfresco)

3) Update dir.root in $ALFRESCO_HOME/ WEB-INF/classes/alfresco/repository.propertes.


dir.root=../../alf_data

4) Create a database alfresco in MySQL


drop database if exists alfresco; create database alfresco character set utf8; grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option; grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

5) Remove the file $ALFRESCO_HOME/WEB-INF/lib/portlet-api-lib.jar 6) Add /WEB-INF/faces-config.xml to the faces config files list at $ALFRESCO_HOME/WEBINF/web.xml like:
<context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-configapp.xml,/WEB-INF/faces-config-beans.xml, /WEB-INF/faces-config-navigation.xml,/WEB-INF/faces-config-common.xml, /WEB-INF/faces-config-repo.xml,/WEB-INF/faces-config-wcm.xml,/WEB-INF/facesconfig-custom.xml</param-value> </context-param>

7) Add files: faces-config.xml, liferay-display.xml, liferay-portlet.xml, portlet.xml to $ALFRESCO_HOME/WEB-INF 8) Create a folder license under $ALFRESCO_HOME /WEB-INF/classes/alfresco/extension and add license file to $ALFRESCO_HOME /WEB-INF/classes/alfresco/extension/ license 9) Package all files as a WAR: alfresco.war; 10) Deploy it in $LIFERAY_HOME/deploy Or, you can use the result WAR directly: download WAR from http://liferay.cignex.com/palm_tree/0387/sso/liferay/alfresco-portlet/alfresco.war and deploy it to $LIFERAY_HOME/deploy. Thats it. Note that you may not be able to add alfresco portlets in liferay pages properly, since alfresco portlets requires to be signed in first. Simple Solution - you can create an account admin/admin (default account in alfresco) in liferay, and assign this account to role Administrator. Then login as admin/admin in liferay, and add alfresco portlets in liferay portal pages, again.

Integration of Liferay, Alfresco, SSO and LDAP

In ten steps, you could be able to integrate Liferay with Alfresco, SSO and LDAP. It is simple for Do-It-Yourselfers, too. Download URL: http://liferay.cignex.com/palm_tree/0387/sso/liferay Demo URL: http://liferay.cignex.com It is available in the book: Liferay Portal 6 Enterprise Intranets

You might also like