Reputation: 5888
Our company needs to use openfire for an xmpp chat app, and we would like to use the already existing table of users for authentication rather than the ofUser table that's a part of openfire. I have already installed openfire on our server and have configured it to use our mysql database and it has created the necessary tables. I'm trying to follow the Custom Database Integration Guide found here
but I can't get it to work. My configuration file is below (with the table names changed slightly):
<jdbcProvider>
<driver>com.mysql.jdbc.Driver</driver>
<connectionString>jdbc:mysql://localhost/fueledin_winkage?user=fueledin_winkage&password=845Fulton</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 users WHERE email=?</passwordSQL>
<passwordType>md5</passwordType>
</jdbcAuthProvider>
<jdbcUserProvider>
<loadUserSQL>SELECT email,email FROM users WHERE email=?</loadUserSQL>
<userCountSQL>SELECT COUNT(*) FROM users</userCountSQL>
<allUsersSQL>SELECT email FROM users</allUsersSQL>
<searchSQL>SELECT email FROM users WHERE</searchSQL>
<usernameField>email</usernameField>
<nameField>email</nameField>
<emailField>email</emailField>
</jdbcUserProvider>
<setup>true</setup>
It's kind of a weird setup because users can change their username whenever so email is used to login. Can someone explain what I may be doing wrong, I tried logging into the server with users in our users table but no luck. Also, after I ran the setup wizard in the browser I edited the configuration script to look like above, and now every time I go to the browser tool it asks me to run the setup wizard again, even if I run it again it still asks afterwards. Any help appreciated thanks in advance.
Upvotes: 0
Views: 5324
Reputation: 308
You have to set the params in the admin interface of openfire. this will do the job for you.
If you'd like to do this in the database, it's the table ofProperty
;)
Edit:
Like this:
Change all XML nodes to something like node.subnode as property names in system properties (in the Server Manager).
E.g.:
<provider>
<auth>
<className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
</auth>
<user>
<className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
</user>
</provider>
will be
provider.auth.className
provider.user.className
Property value are the same, so e.g. value for provider.auth.className
is org.jivesoftware.openfire.auth.JDBCAuthProvider
and value for provider.user.className
is org.jivesoftware.openfire.user.JDBCUserProvider
Upvotes: 3