You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by John Kelly <jo...@uk.ibm.com> on 2002/01/30 17:36:53 UTC

Problems changing the realm with auth_name

Hi,

I'm running Apache/1.3.20 (Win32) mod_perl/1.25_01-dev
and am having problem using auth_name to dynamically set the realm. The 
call seems to be ignored, using the AuthName directive from http.conf.

Excuse me if I've done something obviously wrong, but I've only been 
writing mod_perl for 4 days.

Looking around I saw a note from someone which implied they also had a 
problem with this on NT (I'm running XP Professional) but that was some 
time ago.

After looking through http://perl.apache.org/dist/mod_perl-1.26/Changes
it seems that the problem I am having may well be fixed in 1.26

Being a simple windows programmer, I'd appreciate it if someone could 
point me to a win32 binary distribution of mod_perl for 1.26


My httpd.conf look like this

<Location /private >

   SetHandler perl-script
   PerlSendHeader on
 
   AuthName temp
   AuthType Basic
   require valid-user

   PerlAccessHandler Apache::AccessPrivate 

</Location>

and the access handler part of my AccessPrivate.pm file is here...

sub handler {
 
   my $r = shift;
 
   my $uri = $r->parsed_uri;

   my @pi = split /\//,$uri->path_info();
   shift @pi;
   my $realm = shift @pi;
 
   $r->auth_name("$realm");
   $r->set_handlers(PerlAuthenHandler => [\&authenticate]); 
   $r->set_handlers(PerlHandler => [\&content]);
 
   return OK;
}

regards
john