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 - - 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"?>
<jive>
<adminConsole>
<port>9090</port>
<securePort>9091</securePort>
</adminConsole>
<locale>en</locale>
<connectionProvider>
<className>org.jivesoftware.database.DefaultConnectionProvider</className>
</connectionProvider>
<database>
<defaultProvider>
<driver>com.mysql.jdbc.Driver</driver>
<serverURL>jdbc:mysql://localhost:3306/mydb</serverURL>
<username>root</username>
<password>password</password>
<minConnections>5</minConnections>
<maxConnections>15</maxConnections>
<connectionTimeout>1.0</connectionTimeout>
</defaultProvider>
</database>
<setup>true</setup>
<jdbcProvider>
<driver>com.mysql.jdbc.Driver</driver>
<connectionString>jdbc:mysql://localhost/mydb?user=root&password=password</ connectionString>
</jdbcProvider>
<provider>
<auth>
<className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
</auth>
<user>
<className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
</user>
</provider>
<jdbcAuthProvider>
<passwordSQL>SELECT password FROM app_user WHERE username=?</passwordSQL>
<passwordType>plain</passwordType>
</jdbcAuthProvider>
<jdbcUserProvider>
<loadUserSQL>SELECT CONCAT(first_name,' ',last_name),email FROM app_user WHERE username=?</loadUserSQL>
<userCountSQL>SELECT COUNT(*) FROM app_user</userCountSQL>
<allUsersSQL>SELECT username FROM app_user</allUsersSQL>
<searchSQL>SELECT username FROM app_user WHERE</searchSQL>
<usernameField>username</usernameField>
<nameField>CONCAT(first_name,' ',last_name)</nameField>
<emailField>email</emailField>
</jdbcUserProvider>
<admin>
<authorizedUsernames>admin,sreekj</authorizedUsernames>
</admin>
</jive>
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------
The "ofProperty" table in openfire database also holds the same values as given above.
Could anyone please help....?