You are on page 1of 7

Full Integration - Liferay, Alfresco, SSO and LDAP - Wiki - Liferay

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full%...

Settings

Language

Sign In

Products

Services

Partners

Community

Documentation

Downloads

Community

Wiki

Search...

Home

Blogs

Forums

Issue Tracker

Wiki

FrontPage | Recent Changes | All Pages | Orphan Pages

Search

Full Integration - Liferay, Alfresco, SSO and LDAP


Tags: alfresco integration ldap liferay portlet sso By Jonas Yuan, Draft: 08/18/2009, Updated:08/27/2009

Table of Contents [-] 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-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 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</filter-class> <init-param> <param-name>cas_server_url</param-name> <param-value>https://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 you can update LDAP other than ldap:docs.cignex.com:10389. And more, 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>

1 di 7

03/09/2009 14.37

Full Integration - Liferay, Alfresco, SSO and LDAP - Wiki - Liferay

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full%...

<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

Integration of Liferay, SSO and LDAP


In five steps, you could integrate Liferay with SSO and LDAP. It is simple for Do-It-Yourselfers. 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/WEB-INF/view/jsp/default/ui/casLoginView.jspcasLoingView.jsp from:

<c:set var="query" value="<%=request.getQueryString() == null ? "" : request.getQueryString().replaceAll(

2 di 7

03/09/2009 14.37

Full Integration - Liferay, Alfresco, SSO and LDAP - Wiki - Liferay

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full%...

"&locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]|^locale=([A-Za-z][A-Za-z]_)?[A-Za-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]_)?[A-Za-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/WEB-INF/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

3 di 7

03/09/2009 14.37

Full Integration - Liferay, Alfresco, SSO and LDAP - Wiki - Liferay

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full%...

5) Set up CAS SSO in Liferay Use virtual domain

4 di 7

03/09/2009 14.37

Full Integration - Liferay, Alfresco, SSO and LDAP - Wiki - Liferay

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full%...

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: shutdown the portal Run script: delete from PortletPreferences where portletId = 'LIFERAY_PORTAL'; 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 Do-It-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

5 di 7

03/09/2009 14.37

Full Integration - Liferay, Alfresco, SSO and LDAP - Wiki - Liferay

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full%...

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/WEB-INF/web.xml like:

<context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-config-app.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/faces-config-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

6 di 7

03/09/2009 14.37

Full Integration - Liferay, Alfresco, SSO and LDAP - Wiki - Liferay

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full%...

Demo URL: http://liferay.cignex.com 1784 Views, Comments 0 Attachments

Threaded Replies

Author

Date

hi, I am using liferay with a oracle 10g database... hi, I am using liferay with a oracle 10g database which means I can only have 1 database named XE I was wondering if there is a way to tell alfresco to use that same database ? Pablo M Mino and also, which are the 10 steps for the "Integration of Liferay, Alfresco, SSO and LDAP"? Posted on 8/27/09 4:42 PM.

Pablo M Mino

8/27/09 4:42 PM

(2 Votes) Sign in to vote.

Top

2000-2009 Liferay

Home

About Us

Products

Services

Partners

Community

Documentation

Downloads

7 di 7

03/09/2009 14.37

You might also like