powered by Jive Software

Openfire external (custom) user database

Hi,

thanks to some of the posts in this forum, I’ve finally managed to set up our new Openfire server to use our existing database for authentication. Now I also want to get user information out of this database, but every time I enable my settings, I get an exception when logging into the admin console and clients fail to authenticate. These are the settings I’m using (from a postgresql database):

jdbcUserProvider.allUsersSQL | SELECT username FROM authreg

jdbcUserProvider.emailField | email

jdbcUserProvider.loadUserSQL | SELECT public_name,email FROM co_person WHERE login_name=?

jdbcUserProvider.nameField | public_name

jdbcUserProvider.searchSQL | SELECT login_name FROM co_person WHERE jabber_password != ‘’ AND

jdbcUserProvider.useConnectionProvider | true

jdbcUserProvider.userCountSQL | SELECT COUNT(*) FROM authreg

jdbcUserProvider.usernameField | login_name

and the exception I get is this:

j ava.lang.UnsupportedOperationException
     at org.jivesoftware.openfire.user.JDBCUserProvider.createUser(JDBCUserProvider.java:238)
     at org.jivesoftware.openfire.auth.JDBCAuthProvider.createUser(JDBCAuthProvider.java:368)
     at org.jivesoftware.openfire.auth.JDBCAuthProvider.authenticate(JDBCAuthProvider.java:152)
     at org.jivesoftware.openfire.auth.AuthFactory.authenticate(AuthFactory.java:158)
     at org.jivesoftware.openfire.admin.login_jsp._jspService(login_jsp.java:149)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
     at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
     at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:66)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
     at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:42)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
     at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:70)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
     at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:146)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
     at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
     at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
     at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
     at org.mortbay.jetty.Server.handle(Server.java:324)
     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
     at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
     at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
     at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

This is rather weird, since it looks like Openfire is trying to write to the database I configured, which can’t work because it is supposed to be read-only. And the defined commands are all SELECT commands only, which shouldn’t cause any writing to happen. I wonder if anyone else has seen a similar problem before and can help me with this… thanks in advance.

OK, problem solved - postgresql table access rights were messed up. Once that had been fixed, everything now works. To make things easier, I added a view that only contains the relevant fields from our database in a slightly sanitized format - keeps complexity out of the Openfire configuration.