powered by Jive Software

Can't configure custom authentication


We have been trying to setup custom authentication for some time now without success. What we’re trying to do is use the default embedded OpenFire database for everything except user authentication. We would like to run the use authentication against an external database.

We’ve configured everything according to the documentation, but it just does not seem to be working. It is clear that OpenFire does not even try to run the authentication SQL query on our external database.

Here is our configuration file. If anyone can tell what we’re doing wrong we’ll be greatful.

Thanks in advance!


<?xml version="1.0" encoding="UTF-8"?> <!--
    This file stores bootstrap properties needed by Openfire.
    Property names must be in the format: "prop.name.is.blah=value"
    That will be stored as:
        </prop>     Most properties are stored in the Openfire database. A
    property viewer and editor is included in the admin console.
<!-- root element, all properties must be under this element -->
<jive>   <adminConsole>     <!-- Disable either port by setting the value to -1 -->      <port>9090</port>      <securePort>9091</securePort>   </adminConsole>    <locale>en</locale>    <!-- 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. -->    <!--
    -->    <connectionProvider>     <className>org.jivesoftware.database.EmbeddedConnectionProvider</className>   </connectionProvider>    <setup>true</setup>   <database/> <!-- Authentication and User Integration for external database -->   <provider>     <auth>       <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>     </auth>   </provider>    <jdbcAuthProvider>     <passwordSQL>SELECT Password FROM customer WHERE UserName=?</passwordSQL>      <passwordType>plain</passwordType>   </jdbcAuthProvider>    <jdbcProvider>     <driver>com.mysql.jdbc.Driver</driver>      <connectionString>jdbc:mysql://;password=admin</connectionString>   </jdbcProvider> </jive>

You need to use ?user=root and not ?username=root in your jdbcProvider.connectionString. Hope that fixes it for you.

Thanks for the tip!

I did try it but overall OpenFire just doesn’t work for us.

It seems that custom DB integration is not as simple as the documentation would like us to think…