Interface AuthProvider to implement your own Authentication System

Hello,

In the future my community will be running a phpBB3-Board. My wish for the future is to take all userdata (except some accounts) from the phpBB3 Database. I read a little bit through the Javadocs of the Openfire Server. So after reading all this I have a few questions. First I want to let my users authenticate against the phpBB3 Users. Is ith enough if I implement the interface AuthProvider and register this class through the openfire.xml? Or do I have to implement the interfaces AuthorizationMapping and AuthorizationPolicy too? And when I implemented all needed interfaces and registered them in the openfire.xml how is the authentaction chane in openfire? Does it first try to authenticate against it’s primary database (MySQL in my case) and then against the new AuthProvider? And is it a problem if a user is in both provider (the internal and my one).

The second part of my question ist about the vCards. I want the data for vCards also comes from the phpBB3-database (since there are enough details in the user profiles there). So I think I have to implement the VCardProvider interface. But where do I register this? And would this overwrite the DefaultVCardProvider (I hope not)? And at last, is there any Information about how the org.dom4j.Element is build? I mean how does it look and is there an easy way to construct it on Openfire?

I’ve already implemented an AuthProvider for phpBB3. You can have a look at the source at http://svn.reucon.net/repos/openfire/openfire-phpbb3/trunk/src/main/java/com/reu con/openfire/phpbb3/ the binary is available at http://maven.reucon.com/public-snapshot/com/reucon/openfire/phpbb3/openfire-phpb b3/1.0.0-SNAPSHOT/

I’ve added a new field user_jid to phpBB3 that contains the username without any special characters that were allowed by phpBB3 but are not allowed by XMPP. You can change the source to use the username directly if your phpBB3 is configured to allow only valid XMPP names.

Your custom AuthProvider usually replaces the default one so all users have to be valid phpBB3 users. If you have to you can chain them but that’s not the default behavior.

=Stefan

Wow, I’m impressed. Your wrote nearly exactly what I need. But I have ine question. In the tables of phpBB3 there is alreasy a column “username_clean”. I thought I can just use that column for my username. Or is it even in that column possible that there are characters which are forbidden in XMPP. And which characters would that be?

And at last: Aren’t you the author of Open Archive? I really want to give my users also support for server sided message historys which they could control. But unfortunately Open Archive doesn’t work with Openfire 3.6.2. Is there any possibility that you continue the development on this plugin?

The clean field still seems to include umlauts and spaces as well as [, ] and the like. I guess it’s just the lower case version of the username.

I have a small perl script at http://svn.reucon.net/repos/openfire/openfire-phpbb3/trunk/generate_jid.pl that cleans up the usernames.

P.S. The latest snapshot of Open Archive at http://maven.reucon.com/public-snapshot/com/reucon/openfire/plugins/archive/1.0. 5-SNAPSHOT/archive-1.0.5-20081201.140432-6.jar works with 3.6.2 (rename the jar to archive.jar before deploying it to Openfire)