Forum Moderators: phranque

Message Too Old, No Replies

Missing authentic user name in the Apache log files

         

idealbrain

7:24 pm on Aug 1, 2008 (gmt 0)

10+ Year Member



We have an intranet application using Apache as the web server. This application in Single SignOn enabled. So users who try to access this application , has to login using their SSO ID & pwd.

But I don't this ID information in the Apache webserver log files. I mean in "Field 3." the ID information is not getting into the log files. Our web server admin is not having much knowledge on this. I am hoping someone here can help me. Thanks.

Sample log file format
======================
111.222.333.123 HOME - [01/Feb/1998:01:08:39 -0800] "GET /bannerad/ad.htm
HTTP/1.0" 200 198 "http://www.referrer.com/bannerad/ba_intro.htm"
"Mozilla/4.01 (Macintosh; I; PPC)"
111.222.333.123 HOME - [01/Feb/1998:01:08:46 -0800] "GET /bannerad/ad.htm
HTTP/1.0" 200 28083 "http://www.referrer.com/bannerad/ba_intro.htm"
"Mozilla/4.01 (Macintosh; I; PPC)"

Description of Fields:
============================
· Field 1: User Address
IP or domain name of the user accessing the site.

· Field 2: RFC931
This field is used to log the domain for multi-homed web servers.

· Field 3: User Authentication

· Field 4: Date/Time
Date and time the user accessed the site.

· Field 5: GMT Offset
Number of hours from GMT (if this is +0000 it is logged in GMT time).

· Field 6: Action
The particular operation of the hit (this must be in quotes).

janharders

7:47 pm on Aug 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"single signon" is not very specific - the field in the apache log is the user provided by http authentication. unless that's what your application is using, you won't get it there.

idealbrain

7:51 pm on Aug 1, 2008 (gmt 0)

10+ Year Member



Single Signon using the Siteminder LDAP authentication. I guess it is http authentication?

jdMorgan

9:17 pm on Aug 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If SSO provides a global-context server variable with the username in it, then use Apache mod_log_config [httpd.apache.org] to add another field or to replace Field 3 with the contents of that username variable.

Jim

idealbrain

1:21 pm on Aug 4, 2008 (gmt 0)

10+ Year Member



Thanks Jim for your response. SSO ID is being passed by a header variable and we can capture it in the application using request.getHeader("GEORACLEHRID")

Using the above, can you pls tell what and where exactly need to be changed in the config file, so that this values comes up in the Field 3.

Thank you,
-Ramana

coopster

2:04 pm on Aug 4, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



IIRC, Siteminder sets environment variables. Using the link that jdMorgan provided, you can update your Apache log configuration to write that variable value into each request entry in your log. Don't forget to restart the Apache server after updating the config.

idealbrain

2:20 pm on Aug 4, 2008 (gmt 0)

10+ Year Member



Thanks Coopster. I didn't notice that "mod_log_config" is a link. :)

idealbrain

3:50 pm on Aug 4, 2008 (gmt 0)

10+ Year Member



Coopster \ jdMorgan,
Could you pls explain, how to get the header variable GEORACLEHRID (value set by the SiteMinder) into %u in CLF?
===============
Common Log Format (CLF)
"%h %l %u %t \"%r\" %>s %b"
===============

Thanks.

coopster

6:13 pm on Aug 5, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



%u is always going to be %u, the remote user (from mod_auth, as in password protected directories). You can leave the %u in your common log format and add an additional field. According to the document cited earlier, if you want to show the header variable
GEORACLEHRID
you would add that to the format as:
"%h %l %u %t \"%r\" %>s %b \"%{GEORACLEHRID}i\""

However, as I stated earlier, I thought SiteMinder modified environment variables ... maybe it is header variables, or perhaps even both, you will need to watch your logs during testing to see which is the appropriate directive to use.

idealbrain

7:33 pm on Aug 5, 2008 (gmt 0)

10+ Year Member



It worked! Thanks to coopster and everyone who helped me in this.