on 08/30/04 12:09 Geoffrey Young wrote:
Heh.  Yeah, maybe the point I needed to make more clear is this.  The
PerlAuthenHandler is NOT relying on basic auth to actually have ever
occured.  It is a handler that gets credentials via another service
altogether.  Suffice it to say that no basic auth ever happens, but my
PerlAuthenHandler gets a username.  Now, I want to fool the authz
module, which expects basic auth to have occurred, into thinking that
basic auth occurred.  So, somehow I need to setup the
environment/request object/etc. to accomplish this.
    

ah :)

then all you should need to do is set $r->user to the authenticated user and
you should be good to go.  for completeness, you might also want to set
$r->connection->auth_type to 'Basic', but that is most likely not required
to get things working.
  
Hrmm.  Yeah, this is what I had thought and tried at one point with no luck.  When I use basic auth and let mod_authz_ldap do it's thing, I get "...basic LDAP authentication of user 'test'...", but with my auth module (using the code above) I get "...on user '(null)' failed..." in my logs.  So, basic auth is doing something that I am not to get that user set for the underlying authz module, I just can't figure out what the heck it is.
for more discussions on hacking together your own authentication mechanism,
where both of these things are discussed, see recipes 13.7 and 13.8 in the
mod_perl developer's cookbook.  all of chapter 13 can be read online for free:

  http://www.modperlcookbook.org/chapters/ch13.pdf

HTH

--Geoff

  


-- 
David Castro
Software Architect
Azusa Pacific University

"My little children, let us not love in word or in tongue,
but in deed and in truth." -- 1 Jn 3:18 (NKJ) 

Reply via email to