powered by Jive Software

Openfire integration with Custom Mysql database - users cannot login

Hello All,

I’m trying to get openfire to authenticate and load users from an external users-table (in my case, app_user).

I had followed the documentation provided for the same, but the users in the custom table were not able to login.

(I had also followed the community thread - http://www.igniterealtime.org/community/message/161839 - It didn’t work… )

Also no errors were displayed in the logs.

I noticed that if a user was added to the “ofUsers” table of Openfire, they could login normally. But my requirement is to allow users from my current application’s database to login to openfire.

The content of my openfire.xml is


<?xml version="1.0" encoding="UTF-8"?> 9090 9091 en org.jivesoftware.database.DefaultConnectionProvider com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/mydb root password 5 15 1.0 true com.mysql.jdbc.Driver jdbc:mysql://localhost/mydb?user=root&password=password org.jivesoftware.openfire.auth.JDBCAuthProvider org.jivesoftware.openfire.user.JDBCUserProvider SELECT password FROM app_user WHERE username=? plain SELECT CONCAT(first_name,' ',last_name),email FROM app_user WHERE username=? SELECT COUNT(*) FROM app_user SELECT username FROM app_user SELECT username FROM app_user WHERE username CONCAT(first_name,' ',last_name) email admin,sreekj

The “ofProperty” table in openfire database also holds the same values as given above.

Could anyone please help…?

I found a solution to this

All the above configuration given in openfire.xml would work only if the databases (schemas) defined for openfire and the external users-table are different.

In the above xml, i changed the content from

com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/mydb

to

com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/openfire

and authentication started working fine after a restart !

strange, but it worked

Thanks. This helped me. But the issue is wierd