User authentication from separate database

Hello

I’'m trying to setup wildfire (3.1.0) in cooperation with an existing database. What I would like to accomplish is to fetch users and passwords from that db. I encode passwords with md5 hash and keep them in the db. I tried to use instructions given in file documentation/docs/db-integration-guide.html from wildfire source distribution - specifically the point called “Authentication integration”. However this does not work. Is it known to not work or maybe I should post more details?

Thanks for any help,

Bye

Hi,

the JDBC auth provider should still work (I didn’'t test it anyhow) while the JDBC user provider does not work (JM-848).

Could you please post your configuration (without sensitive information) and error messages if you see some in the log files?

LG

Hello

I added some configuration to wildfire.xml, and that is:

and while trying to log in I’'m getting this:

2006.10.19 07:39:07 org.jivesoftware.wildfire.auth.JDBCAuthProvider.getPasswordValue(JDBCAuthProvide r.java:208) Exception in JDBCAuthProvider

java.sql.SQLException: The url cannot be null

at java.sql.DriverManager.getConnection(DriverManager.java:502)

at java.sql.DriverManager.getConnection(DriverManager.java:193)

If this way of using md5 hashes does not work and will no longer be available, than what is a recomended way to do this?

However I must admit that I like this solution, and it looks extremaly clean to me

Bye, thanks for help

some good info

and/or do a forum search on jdbcAuthProvider - and read carefully, sounds like some of the configuration doc may need some updating.

-Chip

Hi,

the post above should help you to solve the “url cannot be null” issue.

If this way of using md5 hashes does not work and will no longer be available, than what is a recomended way to do this?” md5 hashes do still work as the auth provider is fine. Just the user provider has a problem.

LG

Hello again

I had some hard time posting to this forum lately, so my reply is quite late.

I’'ve tried the suggested solution and it still does not work. However it outcomes in a new error message, which is:

2006.11.02 09:59:40 org.jivesoftware.wildfire.auth.JDBCAuthProvider.getPasswordValue(JDBCAuthProvide r.java:208) Exception in JDBCAuthProvider

org.postgresql.util.PSQLException: FATAL: no PostgreSQL user name specified in startup packet

My config looks almost exactly the same way as I posted previously, but I’'ve added these lines:

but this gives nothing new. Is the tag wrong? How to specify that username?

By the way, it would be nice to have a xml file with all the configuration possibilities, because javadoc isn’'t of much help (at least in this particular situation).

Do you have any ideas how to solve this problem?

Bye

Marcin

Hi,

for me

<jdbcProvider>
    <driver>com.mysql.jdbc.Driver</driver>
    <connectionString>jdbc:mysql://localhost/dbname?user=username&amp;password=secret</connectionString>
  </jdbcProvider>

looks fine, so you need to add the username with “?user=” and the password with “&password=”.

LG

Hello

You were right as for the connectionString. I had to add this.

But new errors follow:

2006.11.02 20:57:42 org.jivesoftware.wildfire.auth.JDBCAuthProvider.getPasswordValue(JDBCAuthProvide r.java:208) Exception in JDBCAuthProvider

org.postgresql.util.PSQLException: Index out of bound: 1, number of columns: 0.

The only thing added is the ?user=–&password=– part, nothing more. This seems to be an error on line 205 in JDBCAuthProvider.java However it seems unreasonable, because I’'ve passed password parameter.

Any ideas?

Bye

The forum could kill me. I expect that you need to use “&amp;” and not “&” as a seperator for the password as you must escape “&” in XML.

I did that, the forum also changed my post. I have an XML entity for & there, so it should work this way.

Hi,

ah, the connection to the database seems to be fine, but

Or add a user with name “?” - this is possible and for this users your query will return the password (;

LG

Thanks for Your help, all that solved my problem. Now even md5 passwords work.

Seems that it was mainly caused by not specified (and then wrongly specified) connectionString.

Bye