You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Steven Lembark <le...@wrkhors.com> on 2001/05/31 05:30:50 UTC

Trying to find correct format for PerlSetVar's -- or get Apache::AuthNetLDAP working.

Eagle gives number of examples, none of which is a PerlSetVar.
guessing it would be a hash of var's to set with values.
Not having much luck -- Apache::AuthNetLDAP fails with:

[Wed May 30 23:33:21 2001] [notice] Apache/1.3.19 (Unix) mod_perl/1.25
configured -- resuming normal operations
[Wed May 30 23:33:21 2001] [info] Server built: May  4 2001 18:38:57
[Wed May 30 23:33:31 2001] [error] Can't call method "bind" on an
undefined value at
	/usr/local/perl5/lib/site_perl/5.6.1/Apache/AuthNetLDAP.pm line 57.

which is running:

    47     my $ldap = new Net::LDAP($ldapserver, port => $ldapport);
    48
    49     my $mesg;
    50     #initial bind as user in Apache config
    51     if ($bindpwd ne "")
    52     {
    53         $mesg = $ldap->bind($binddn, password=>$bindpwd);
    54     }
    55     else
    56     {
    57         $mesg = $ldap->bind();
    58     }
    59
    60     #each error message has an LDAP error code
    61     if (my $error = $mesg->code())
    62     {
    63          $r->note_basic_auth_failure;
    64          $r->log_reason("user $username: LDAP Connection Failed:
$error",$r->uri);
    65          return AUTH_REQUIRED;
    66     }


problem seems to be that i'm not getting the PerlSetVar's 
across to it via perly config:

   164		$Location{'/blah'} = 
   163          {
   164              SetHandler  => 'perl-script',
   165
   166              PerlAuthenHandler   => 'Apache::AuthNetLDAP',
   167   
   168              PerlSetVar  =>
   169              {
   170                  BindDN      => 'employeenumber=123456 ou=people
o=foo.bar',
   171                  BindPWD     => 'password',
   172                  BaseDN      => 'ou=people o=foo.bar',
   173                  LDAPServer  => 'ldap.alltel.com',
   174                  LDAPPort    => '389',
   175                  UIDAttr     => 'sn',
   176              },
   177
   178              AuthName    => '/tdrdw',
   179              AuthType    => 'Basic',
   180
   181              require     => 'valid-user',
   182
   183              PerlSetEnv  => "BASEURL http://$host:$Port/tdrdw",
   184              PerlHandler => 'Tdrdw::Welcome',
   185          },


is there any better doc for this than the eagle book?

-- 
 Steven Lembark                                   2930 W. Palmer St.
                                                 Chicago, IL  60647
 lembark@wrkhors.com                                   800-762-1582

Re: Trying to find correct format for PerlSetVar's -- or get Apache::AuthNetLDAP working.

Posted by Thomas Eibner <th...@stderr.net>.
On Wed, May 30, 2001 at 10:30:50PM -0500, Steven Lembark wrote:
> problem seems to be that i'm not getting the PerlSetVar's 
> across to it via perly config:
[Snip]
> is there any better doc for this than the eagle book?

You have to use $r->dir_config('Var') to get the values from the configuration file.
Example:
my $BindDN = $r->dir_config('BindDN'); 

See:
<http://perl.apache.org/guide/config.html#PerlSetVar_PerlSetEnv_and_PerlP>

-- 
  Thomas Eibner <http://thomas.eibner.dk/> - DnsZone <http://dnszone.org/>
  mod_pointer <http://stderr.net/mod_pointer>