Multiple Authentication Types

Hey all, just installed OpenFire and got it working authenticating users against Active Directory. I also need to be able to authenticate some users against a custom database, at the same time. Ideally it would attempt to authenticate against one, then the other. Is this possible with OpenFire?

If not, another thought I had would be to have two hosts, two instances of openfire. One for the AD logins, the other for the custom database login. Then just open up server-to-server communication between the two. Thoughts on this setup?