Good day to everyone.
I want to integrate my custom SQL Server database (named OpenFireDB) with the one provided by OpenFire.
I am following the tutorial described in:
#1 http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/db-integ ration-guide.html
To start OpenFire, I have done the steps explained in:
#2 http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/database .html#sqlserver
to see if OpenFire worked with my database with success.
Now, I begin the steps described in #1
I stop OpenFire and open my XML file (conf/openfire.xml)
I follow the steps and my file ends like this:
<?xml version="1.0" encoding="UTF-8"?>
<jive>
<adminConsole>
<port>9090</port>
<securePort>9091</securePort>
</adminConsole>
<locale>en</locale>
<!-- OPENFIRE DATABASE -->
<connectionProvider>
<className>org.jivesoftware.database.DefaultConnectionProvider</className>
</connectionProvider>
<database>
<defaultProvider>
<driver>net.sourceforge.jtds.jdbc.Driver</driver>
<serverURL>jdbc:jtds:sqlserver://christian/OpenFireDB;appName=jive</serverURL>
<username>XX</username>
<password>XX</password>
<testSQL>select 1</testSQL>
<testBeforeUse>true</testBeforeUse>
<testAfterUse>true</testAfterUse>
<minConnections>5</minConnections>
<maxConnections>25</maxConnections>
<connectionTimeout>1.0</connectionTimeout>
</defaultProvider>
</database>
<!-- SETUP FINISHED -->
<setup>true</setup>
<!-- DATABASE CONNECTION SETTINGS FOR EXTERNAL DATABASE -->
<jdbcProvider>
<driver>net.sourceforge.jtds.jdbc.Driver</driver>
<connectionString>jdbc:jtds:sqlserver://christian/OpenFireDB;appName=jive??user =XX&password=XX</connectionString>
</jdbcProvider>
<!-- AUTHENTICATION AND USER INTEGRATION FOR EXTERNAL DATABASE -->
<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 username=?</passwordSQL>
<passwordType>plain</passwordType>
</jdbcAuthProvider>
<!-- USER DATA ACCESS FROM OPENFIRE -->
<jdbcUserProvider>
<loadUserSQL>SELECT name,email FROM users WHERE username=?</loadUserSQL>
<userCountSQL>SELECT COUNT(*) FROM users</userCountSQL>
<allUsersSQL>SELECT username FROM users</allUsersSQL>
<searchSQL>SELECT username FROM users WHERE</searchSQL>
<usernameField>user_name</usernameField>
<nameField>name</nameField>
<emailField>user_email</emailField>
</jdbcUserProvider>
</jive>
My database contains a table called "USERS" with these columns:
USER_NAME, NORMAL_PASSWORD, UBER_PASSWORD, NAME, USER_EMAIL
NORMAL_PASSWORD is a column to make tests with plain passwords
UBER_PASSWORD is a colum to make tests with encrypted passwords once I am able to connect my database with OpenFire
And that is the reason I have written it in a different from the tutorial in section <jdbcUserProvider>
Instead of "user_account" which is written in the tutorial, I think that I should write there the table where my users are (USERS)
I have done the same for the sections where "myUsers" table is referred in that guide.
I have even tried not changing the "user_account" table in section <jdbcAuthProvider> to try if it worked; but it did not.
Then, following steps in #1, I start again OpenFire
I click on "Launch Admin", I log with my admin account and check the Users/Groups section, in Users Summary.
1.- I do not see the user I have in my USERS table, that should be integrated dynamically in OpenFire.
2.- If I add a new user in that interface, it only updates the table "ofUser" of OpenFire, but does not generate that user in my table
What am I doing wrong?
Would you mind explaining me my flaws and telling me how to do this properly, please?
Thank you very much for your Time and have a nice day (^_^)