Forum Moderators: phranque

Message Too Old, No Replies

mutiple colums with mod authn mod

mod_authn_mod

         

jrufener

2:23 pm on Jun 27, 2011 (gmt 0)

10+ Year Member



Hello all, I have an Apache server versions 2.2.19 built against apr-1.4.5 and apr-util-1.3.12. I am using digest authenication against a Postgres database using mod_authn_dbd. Authenication works properly and was relatively easy to configure. The mod_authm_dbd documentation states that:

If httpd was built against APR version 1.3.0 or higher, then whenever a query is made to the database server, all column values in the first row returned by the query are placed in the environment, using environment variables with the prefix "AUTHENTICATE_".

If a database query for example returned the username, full name and telephone number of a user, a CGI program will have access to this information without the need to make a second independent database query to gather this additional information.

This has the potential to dramatically simplify the coding and configuration required in some web applications.


I have query that returns two colums:

AuthDBDUserRealmQuery "SELECT md5hash, lname FROM users \
WHERE lower(\"UserName\") = %s AND realm = %s"
I am expecting to find an environment variable of the form AUTHENICATE_LNAME or AUTHENTICATE_lname (the documentation is unclear on this point), I find neither and in fact find no environment variable of the form AUTHENICATE_ anything.

Anyone have any experience with this?

jrufener

5:44 pm on Jun 27, 2011 (gmt 0)

10+ Year Member



Perhaps some more information.

I used ldd to verify that httpd was using the proper apr libraries - it is.

I modified the mod_authn_dbd.c sources to put a pragma in the poritons that are compiled only for the new libraries. I then re-built apache the messages indicate the proper code was built in. I placed code in the mod_authn_dbd.c to log, into the error log, when authentication takes place and when an environment variable is added. Neither is logged. This means to me that the code is not being executed - but if I change the query string to make it invalid the authentication fails meaning the data is being used.

jrufener

5:35 am on Jun 28, 2011 (gmt 0)

10+ Year Member



Finally got it working. The problem was that some symbolic links were left in place that actually executed the wrong dso's. I figure it out by uing stat to find which object were being accessed.