powered by Jive Software

Custom database integration

Hi,

I have recently installed Openfire, and I would like to try and connect to an already existing database for the username and passwords for logging in (users and admins). I have set up my config file as per the instructions, but I cannot log in to the admin page using the username I have set up as admin, or login via Spark as a user. I get no error messages in the logs. Here is my config file: (note that any ‘&’ chars are defined as ‘&’ in my config file, and it is this editor that is changing them to ‘&’)

<jive> <adminConsole> <port>9090</port>
<securePort>9091</securePort> </adminConsole> <admin> <authorizedUsernames>KeithT,admin</authorizedUsernames> </admin> <locale>en</locale> <connectionProvider> <className>org.jivesoftware.database.DefaultConnectionProvider</className> </connectionProvider> <database> <defaultProvider> <driver>org.postgresql.Driver</driver> <serverURL>jdbc:postgresql://127.0.0.1:5432/jabber</serverURL> <username>xxx</username> <password>xxx</password> <minConnections>5</minConnections> <maxConnections>50</maxConnections> <connectionTimeout>1.0</connectionTimeout> </defaultProvider> </database> <setup>true</setup> <!-- Qiro User setup --> <jdbcProvider> <driver>org.postgresql.Driver</driver> <connectionString>jdbc:postgresql://127.0.0.1:5432/xxx?user=xxx&password=xxx</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 credentials WHERE nickname=?</passwordSQL> <passwordType>md5</passwordType> </jdbcAuthProvider> <jdbcUserProvider> <loadUserSQL>SELECT forename,email FROM credentials WHERE nickname=?</loadUserSQL> <userCountSQL>SELECT COUNT(*) FROM credentials</userCountSQL> <allUsersSQL>SELECT nickname FROM credentials</allUsersSQL> <searchSQL>SELECT nickname FROM credentials WHERE</searchSQL> <usernameField>nickname</usernameField> <nameField>forename</nameField> <emailField>email</emailField> </jdbcUserProvider> </jive>
Any ideas? Thanks in Advance Keith Thorne

Message was edited by: Keith Thorne

Hi Keith,

my warn log logs

2007.11.26 22:34:21 SaslException
javax.security.sasl.SaslException: PLAIN authentication failed [Caused by javax.security.sasl.SaslException: PLAIN: user not authorized: username]
at org.jivesoftware.openfire.sasl.SaslServerPlainImpl.evaluateResponse(SaslServerPlainImpl.java:144)
at org.jivesoftware.openfire.net.SASLAuthentication.handle(SASLAuthentication.java:229)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:152)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:132)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:162)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:240)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:284)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.security.sasl.SaslException: PLAIN: user not authorized: username
at org.jivesoftware.openfire.sasl.SaslServerPlainImpl.evaluateResponse(SaslServerPlainImpl.java:127)
... 17 more

Some time ago this did work fine, so it looks to be an Openfire problem, there’s also http://www.igniterealtime.org/community/thread/30321 with a similar problem, so we are now three.

Edited: It still works fine, but not if the user name contains upper chars like “helloJoe” - this causes the exception.

LG