[rt-users] Undefined value using RT::Authen::ExternalAuth::LDAP

Mike Peachey mike.peachey at jennic.com
Mon Dec 21 14:24:32 EST 2009


Matt Adams wrote:
> Nick Kartsioukas wrote:
> 
>> Check all your ExternalAuth settings in RT_SiteConfig.pm.  Things like
>> 'filter' and 'd_filter' cannot be empty, they must have some value.  I
>> have filter set to '(objectClass=*)' to always match, and d_filter set
>> to '(objectClass=ThisWillNeverMatch)' to never match (as I have no such
>> attribute in LDAP).
> 
> Unfortunately both of those settings are configured properly.  This 
> error just started appearing out of the blue.  I haven't changed 
> anything recently.

It is definitely related to the filter. The problem is in UserExists 
which ensures that the user actually exists in the user database, and is 
run once for each specified database iirc.

Shortened for simpicity:

#################################################################
my $config = $RT::ExternalSettings->{$service};
my $filter = $config->{'filter'};

if ($filter eq "()") { undef($filter) };

if (defined($config->{'attr_map'}->{'Name'})) {
   # Construct the complex filter
   $filter = Net::LDAP::Filter->new(
     '(&' . $filter . '(' . $config->{'attr_map'}->{'Name'} . '=' . 
$username . '))');
}

my @attrs = values(%{$config->{'attr_map'}});

# Check that the user exists in the LDAP service
$RT::Logger->debug( "LDAP Search === ",
                         "Base:",
                         $base,
                         "== Filter:",
                         $filter->as_string,
                         "== Attrs:",
                         join(',', at attrs));

my $user_found = $ldap->search( base    => $base,
                                 filter  => $filter,
                                 attrs   => \@attrs);

#################################################################

The filter information is taken directly from your config and used to 
build a filter object. There is then a debug message that uses as_string 
to print out the filter object. In your case, $filter is not a defined 
object and so the as_string call is invalid.

Double, triple and then quadruple check your filter value in the config.
-- 
Kind Regards,

__________________________________________________

Mike Peachey, IT
Tel: +44 114 281 2655
Fax: +44 114 281 2951
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
Comp Reg No: 3191371 - Registered In England
http://www.jennic.com
__________________________________________________



More information about the rt-users mailing list