I read the answer from Dieter and unfortunately I'm not authenticating
from Apache. So, I went for the approach indicated by Chris Withers
without any success:

> If your Zope auth solution can put a header in the http response, then > you can use a custom apache logging directive to put this in your
 > Apache log in place of what it thinks the username is.
I put this on the "log" method of the medusa/http_server.py file:

and set my apache access log like this:
CustomLog /home/apache/httpd/logs/access_log combined

The combined log is defined as follows:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

There you see the %l and %u directives, which are the "Remote logname" and the "Remote user".

But apache still doesn't get the zope authenticated user. So, Chris, do you remember what header you set, where, and which method you used?
Ok, Answering to this question. I guess I had to set the header inside the
authenticate method of the BasicUserFolder class. Here is what I did:

def authenticate(self, name, password, request):
    emergency = self._emergency_user
    user = None
    if name is None:
        if emergency and name==emergency.getUserName():
            user = emergency
            user = self.getUser(name)
        if user is not None and user.authenticate(password, request):
            user = None
     logUser = 'Anonymous'
     if (user != None):
         logUser = user.getUserName()
     return user

The header is set, but apache still doesn't get it, so, I guess I'm using the wrong name. What header should I use?


Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to