Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
Integration of JBoss Portal with OpenDS LDAP Server Step by Step HowTo By Kefa Rabah,
[email protected]
April 9, 2009
Part 1:
The goal of this article is to provide step by step instructions on how to integrate and configure JBoss Portal with LDAP support. The OpenDS LDAP server is used as a user store. You will learn the basic configuration that needs to be done to leverage a directory server in your portal deployment. Before we start you will need to get the following packages: 1. JBoss Portal sources: The best way to obtain latest JBoss Portal 2.6 sources is to use Subversion: $ svn co http://anonsvn.jboss.org/repos/portal/tags/JBoss_Portal_2_6_0/ jboss-portal-2.6 2. JBoss Application Server 4.2.3.GA. It can be downloaded from here: http://labs.jboss.com/jbossas/downloads You need to download the .zip version and simply unpack it somewhere on your disk. Before you proceed, the 'JBOSS_HOME' environment variable should be set to point to directory containing unpacked archive. Under Linux you can use: $ export JBOSS_HOME=/usr/JBoss/jboss-4.2.3.GA For complete JBoss setup HowTo, check out our blog URL www.serengetisys.com/blog or else within scrbd.com by the same author. 3. Run JBoss AS: $ cd $JBOSS_HOME/bin [bin]$ ./run.sh
Part 2: Preparing the LDAP directory. And Provision LDAP with sample data. 1. OpenDS Setup 1. In this tutorial we'll use OpenDS directory server. Download the QuickSetup.jnlp version to your temp directory. 2. Locate the package and double-click it to start the installation process and follow the installation Wizard the instruction. 3. I use port 10389, use "password" as password, Directory Base DNS: "dc=example,dc=com"; 4. Do not pre-populate with random use. Instead "Import Data from LDIF file" option. You will find ldif containing sample LDAP tree in portal sources (jbossportal-2.6/identity/src/resources/example/portal-sample-local.ldif), see figure below.
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
1
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
5.
Integration of JBoss Portal and OpenDS LDAP v1.2
The final setup page should look like the figure shown below:
6. Click "Launch Control-Panel" to startup your OpenDS server listening on port 10389, or via cmd type: /usr/OpenDS/bin/control-panel from the OpenDS Control Pane > Server Status click Start to start the OpendDS server, and enter your credentials to logon. 2. Install LDAPBROWSER 1. At the moment you should have an instance of the OpenDS LDAP server listening on port 10389. 2. To be able to use it with portal we need to provision it with sample data. To do this we'll use simple LDAP tool with GUI written in Java – the LDAP Browser/Editor. It's a very lightweight tool that runs on many environments. Follow installation notes specified here: http://www.openchannelsoftware.com/projects/LDAP_Browser_Editor 3. You will simply need to download the archive, unpack it and run the lbe.sh or lbe.bat script (assuming that you have the java command in your operating system path). © September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
2
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
4. My standard setup puts the unarchived app code into a directory called /usr/ldapbrowser, which I normally create by simply copying Browser282b2.tar.gz to /usr and doing a tar xvzf on it right there 5. Next cd to the installed directory, and run the ./lbe.sh on Linux or double-click lbe.bat on windows script to start the ldapbrowser 6. If you are using Fedora Linux you can also find 'lbe' rpm package in Dries repository. 7. Run LDAP Browser/Editor, and choose menu File > Connect
• • • • • • • •
Change to 'Quick Connect' tab and enter following information: host: localhost port: 10389 leave 'Base DN' empty uncheck 'Annonymous bind' checkbox user DN: cn=Directory Manager password: password click 'Connect'
8. You should be able to see the imported LDAP tree.
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
3
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
9. Shutdown JBOSS AS: $ cd $JBOSS_HOME/bin [bin]$ ./shutdown.sh -S
3. JBoss Portal Setup JBoss Portal leverages OpenDS for unit tests so in the source distribution you can find an embedded directory server that can be deployed on JBoss Application Server. 1. Build JBoss Portal sources by doing: [jboss-portal-2.6] $ ./build/build.sh This may take a while as all necessary libraries have to be downloaded from a library repository. During this tutorial we'll assume that you’re using Linux. But you will also find proper '.bat' scripts for Windows operating system as well. 2. Deploy OpenDS directory server [jboss-portal-2.6] $ ./identity/build.sh deploy-ldap this will copy necessary files into the JBoss AS pointed by 'JBOSS_HOME' environment variable.
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
4
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
4. Configure JBoss Portal LDAP support JBoss is preconfigured to work with a locally deployed OpenDS. To enable LDAP support only tiny modification is needed: 1. Edit file jboss-portal-2.6/core/src/resources/portal-core-sar/META-INF/jbossservice.xml and change following line: 'conf/identity/identity-config.xml' to 'conf/identity/ldap_identity-config.xml' You will find configuration details in jboss-portal-2.6/core/src/resources/portal-coresar/conf/identity/ldap_identity-config.xml 2. Install JBoss Portal: [jboss-portal-2.6] $ ./build/build.sh deploy-all [jboss-portal-2.6] $ ./core/build.sh datasource [jboss-portal-2.6] $ cp ./core/output/resources/setup/portal-hsqldbds.xml $JBOSS_HOME/server/default/deploy/ 3. Run JBoss Portal $ cd $JBOSS_HOME/bin [bin] $ ./run.sh
5. Basic Testing. • • • • •
Ensure first that no server is running Start OpenDS server Start JBoss Portal If portal starts clean and lets you log in as admin then it verifies that the setup is correct. Try modifying some property of any user through Identity Management Portlet such as email address. You should be able to see the change through LDAP browser on LDAP server as well.
1. At the moment JBoss Portal should store identity related data in LDAP store. Let's check it out. 2. Open your browser and go to http://localhost:8080/portal Click Login link and enter your credentials
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
5
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
3. Login as user 'jduke' with password 'theduke'. This is the user account we added into LDAP in previous steps.
4. On the bottom left hand side of the page, click on the 'Edit your profile' link.
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
6
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
5. In the 'Real e-mail' field enter '
[email protected]' and click 'Save changes' button at the bottom.
6. Refresh the view in LDAP Browser and check that new email address was updated in proper user entry 7. Logout from portal and login back as user 'admin' with password 'admin'. 8. Click on the 'Admin' link in the top right corner and go into 'Members' tab. 9. Click on the 'Create User Account' link.
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
7
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
10. Fill in the form with sample data and click 'New user registration' 11. Verify in LDAP Browser that new user entry was added to the directory
12. Try to login with username and password you specified for the new account, logout. 13. Log back with admin account and again click the 'Members' tab – from here you can also list and manage all the users that are present in LDAP, e.g., from user role click members link.
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
8
A GOV Open Knowledge Access License Technical Publication
Global Open Versity, Vancouver Canada
Integration of JBoss Portal and OpenDS LDAP v1.2
14. It’s also possible to assign specific roles to them. For example, we can assign user krabah an Admin role. Try it out!
Summary Once you have your integrated JBoss Portal and OpenDS LDAP running – you can extend it to implement Single-Sign-On (SSO) and other network access and related users provisioning solutions. And also integrate it with CRM like SugarCRM the most powerful open source CRM systems. ----------------------Kefa Rabah is the Founder and CIO, of Serengeti Systems Group Inc. Kefa is knowledgeable in several fields of Science & Technology, IT Security Compliance and Project Management, and Renewable Energy Systems. He is also the founder of Global Open Versity, a Center of Excellence in online eLearning.
© September 2008, Kefa Rabah, Ph.D.
www.globalopenversity.com
Global Open Versity, Vancouver Canada
9
A GOV Open Knowledge Access License Technical Publication