Custom Database Integration with Kohana


I am using the Kohana PHP framework for my website and i would to add authentication from users in an external database.

I read the Custom Database Integration Guide : ration-guide.html

My openfire database is called ‘openfire’ and my website database is called ‘kohana’.

When i login to the Openfire Admin Console the users from the kohana database are NOT shown in the User Summary or Group Summary.

I think i’ve made a mistake in my config file, when i remove defaultProvider it seems Openfire is installing the new tables in the database ‘kohana’ wich i do not preffer.


          <!-- Disable either port by setting the value to -1 -->
     <!-- Network settings. By default, Openfire will bind to all network interfaces.
     Alternatively, you can specify a specific network interfaces that the server
     will listen on. For example, This setting is generally only useful
     on multi-homed servers. -->
               <testSQL>select 1</testSQL>
          <passwordSQL>SELECT password FROM users WHERE username=?</passwordSQL>
          <loadUserSQL>SELECT firstname,email FROM users WHERE status = 5 AND username=?</loadUserSQL>
          <userCountSQL>SELECT COUNT(*) FROM users WHERE status = 5</userCountSQL>
          <allUsersSQL>SELECT username FROM users</allUsersSQL>
          <searchSQL>SELECT username FROM users WHERE status = 5 AND</searchSQL>
          <groupCountSQL>SELECT count(*) FROM roles</groupCountSQL>
          <allGroupsSQL>SELECT name FROM roles</allGroupsSQL>
          <userGroupsSQL>SELECT description FROM roles WHERE id IN (SELECT role_id AS id FROM roles_users INNER JOIN users ON (roles_users.user_id = WHERE status = 5 AND username=?)</userGroupsSQL>
          <descriptionSQL>SELECT description FROM roles WHERE name=?</descriptionSQL>
          <loadMembersSQL>SELECT username FROM users WHERE status = 5 and id IN (SELECT user_id AS id FROM roles_users INNER JOIN roles ON (roles_users.role_id = WHERE</loadMembersSQL>
          <loadAdminsSQL>SELECT username FROM users WHERE status = 5 and id IN (SELECT user_id AS id FROM roles_users INNER JOIN roles ON (roles_users.role_id = WHERE</loadAdminsSQL>

More information about the users table :

I changed the System Properties:


org.jivesoftware.openfire.auth.DefaultConnectionProvider => org.jivesoftware.openfire.auth.JDBCAuthProvider


org.jivesoftware.openfire.auth.DefaultConnectionProvider => org.jivesoftware.openfire.auth.JDBCUserProvider

Now i can no longer login to the Admin Console

Help appreciated!

CRAP!, the passwords are stored with sha256 using salt that would explain why the login doesnt work.

I could make changes to the Openfire JDBCAuthProvider->authenticate() function, But its been years ago programming JAVA.

Not sure what todo, it will take me a few days i think.

Maybe i’ll just insert users directly into the Openfire Datase with SQL query’s from my website.


David van der Tuijn

Message was edited by: David van der Tuijn