try another color:
try another fontsize: 60% 70% 80% 90%
dueyesterday.net
Documentation for the masses

How to Integrate XMPP (Openfire) Chat into Drupal and your Environment

Table of Contents:

Summary

This documentation is to serve for anyone looking to integrate an enterprise XMPP/Jabber solution into both their environment and Drupal installation which would then be able to facilitate a complete federated chat solution accessible by multiple clients (Mac, Windows, Linux and Mobile). It is assumed that an environment is already in place for authenticating users and supporting servers. 

This step-by-step walk through will be using Openfire as the XMPP server, Active Directory as the LDAP repository and an Apache server to run Drupal. All installations aside from Active Directory will be running on Ubuntu 8.04 LTS.

Before we begin, I want to cover why you may consider implementing this solution. The reasoning of why I initially came up with this was to promote communication in a corporate environment. I needed a compliant and enterprise solution to provide chatting to users, but at a low cost to deploy. Using services from Google or other providers left me without control of the traffic. Having something local was required, but the solution needed to provide the ability to plug into other chatting implementations if need be.

XMPP/Jabber provides for the ability to bridge multiple chat implementations and runs using the open standard. This, among other reasons pushed me to using XMPP internally. I could host my own chatting solution (attach monitoring, control client usage, view metrics, etc.) and still allow for communication to other chat clients such as Google, Yahoo or AIM. Using XMPP also meant that I could use a wide variety of clients (web, javascript, thick, and mobile) without picking just one. 

Having picked the chatting solution, I needed to integrate that into an existing Drupal installation. Drupal was perfect, not only because the popularity of the framework, but because it too promoted collaboration and communication (through blogs, polls, and pages). What better way to extend that functionality then to add real-time chatting capabilities. Searching online did not reveal any clear and concise documentation for doing such a task, so this is why you are now reading this.

Your rating: None Average: 3.6 (27 votes)

Comments

without ldap user sync?

Hey there,great Tutorial but do you know a solution to sync users without using a ldap server?I think it opens may security issues and is not really needed for this "small" user sync.king regards

Depends on your XMPP solution

If you are using Openfire then I know you can use MySQL for your backend database. Keep in mind that Drupal also uses MySQL. In theory you could created a stored procedure to copy the Drupal user related information out of the Drupal database and copy it over into the Openfire database. Obviously you would need to account for the changes in table structure, constraints and encryption, but I think it would work. You would also need to look into the amount of times a stored proc. could be called throughout the day (depending on how much your are worried about syncing the information).  

Hey

just found a patch in the xmpp framework module queue that solves this problem. There is temporaly one error you got while the module syncs the user db but it works like a charm.If I can find it I will post it here but i already serched and it is not very clear for me why it works but also creates an error :).

Almost done, but

Hi great article, really great article, quite impressive. I've made through the end in a couple of days, first fixing problems with LDAP, then Centos didn't want to install mod_authz_ldap, then i got some problem redirecting to http-bind. I guess i solved most of the problems now if i try to go to my-site-url.com/http-bind/ i get an error 400 of bad request. Pidgin works with openfire i can see the sessions too, i can make rooms on conference.my-site.com too. The last problem is that in the XMPP_CLIENT block i see only the configure chat link even if i put the JID on the configuration page. I'm the only user for now, is this the problem ? I must have more than one user ?Another question, there's a way to check that my mod_authnz_ldap configuration is working propertly ?Thanks and great article!

Hi it's me again

Hi i solved the problem i was asking for, and i discovered that openfire can use an external database for user authentication so i set up the openfire.xml file to use the Drupal user table without needing stored procedure o synching problems, here is the article for Openfire custom authentication.http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/...Bye and keep up the good work.

Glad you solved your issue!

 What is the account you were trying to register? I will go in and make sure everything is setup for you. Thanks for the praise and if you don't mind me asking, was there anything you think I should add to the walk through to make it better? 

Maybe some more infos about...

Hi it wasn't me that got problem with the registration process. I was the one asking for the problen that then i solved it. For the article you can explain more in detail how to configure LDAP for openfire. I've already know how to use LDAP so i got no problem, but it can't be clear how to set up a functional dc for openfire to a newbie. Also you can leave an example to how to edit the httpd.conf file (for mod_proxy and mod_authnz_ldap), just a bit of the conf file to show to a less experienced user the concept of the <Location> tag. The most useful tip is that you put a section for configuring openfire to work with the drupal users db table. I guess that most users have this tipe of configuration and use LDAP (as i said) can be painful to some LDAP newbies. I've posted the link for the guide to customize openfire db authentication.If you need i can write some lines about how i did it and post my openfire.xml file, but the openfire tutorial is quite straightforward. The omission on the openfire tutorial is that you must set the same type of auth connection type that you use in the openfire.xml (if you use JDBCAuth..., you must set JDBCAuth... on the admin option in openfire administration page or the authentcation fails).cya! Marco

thanks

Hi great article. I want to publish this article on my own if allowed. my website estetik

 Just credit back here and I

 Just credit back here and I have no issues with that.

Integration without LDAP

5

Hi.I´ve found yout tutorial very useful and I´ve set up the server and the drupal module. I have Drupal and Openfire on the same machine so I didn´t have to pass through the proxy configuration.I have not used the ldap config to use one sign on so I have to separate tables for users, one in drupal and the other one in openfire. I have configured my openfire user account on my drupal user profile, but when i push the launch XWChat button the chat return the following error: "Wrong combination Username / Password. Please re-loign to the site for synchronization. Disconnected from Server".The openfire user works perfectly on Pidgin. The config of drupal is ok i thing. The http-binding works well and It´s correctly configured. Any idea of what could be wrong? Thanks in advance.

Shoot me an email

This is something that has come up before and I have tried to help with, but was never 100% successful. I know in my early installation of the xmppframework that the password decryption function was never working correctly. This in turn would mangle passwords being sent to the openfire server. I was able to see this by using firebug within firefox and watching the authentication process (in the clear without MD5).

Send me an email and I can try and help you out more...

brandon.s.dixon@gmail.com