[rt-users] import ldap users in RT with RT::Authen::ExternalAuth

Natxo Asenjo natxo.asenjo at gmail.com
Fri Jul 3 14:30:38 EDT 2009


hi,

I found this:

http://www.cpan.org/modules/by-module/RT/RT-Extension-LDAPImport-0.06.tar.gz

and installed it according to the instructions in the README. My RT
installation is also vanilla 3.8.3, so everything is in /opt/rt3

The settings in RT_SiteConfig.pm are:

Set($LDAPHost,'host.domain.tld');
Set($LDAPUser, 'cn=user,dc=domain,dc=tld');
Set($LDAPPassword, 'password');
Set($LDAPBase, 'ou=users,dc=domain,dc=tld');
Set($LDAPFilter, 'cn = *');
Set($LDAPMapping, {Name         => 'uid',
                    EmailAddress => 'mail',
                    RealName     => 'cn',
                    WorkPhone    => 'telephoneNumber',
                    Organization => 'departmentName'});


Set($LDAPGroupName,'Imported Users');
Set($LDAPUpdateUsers,1);

The first run wasn't very sucessful:

Can't locate RT/Extension/LDAPImport.pm in @INC (@INC contains:
/opt/rt3/local/lib /opt/rt3/lib /etc/perl /usr/local/lib/perl/5.10.0
/usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at
./rtldapimport line 13.

I had to add this path to rtldapimport because it would not find a module:

### after:     use lib qw(@RT_LIB_PATH@);
    use lib qw(/opt/rt3/local/lib /opt/rt3/lib
        /opt/rt3/local/plugins/RT-Extension-LDAPImport/lib);

After that it runs

host:/opt/rt3/local/plugins/RT-Extension-LDAPImport/bin# ./rtldapimport --debug
Starting import
connecting to host.domain.tld
binding as cn=user,dc=domain,dc=tld
searching with base => 'ou=users,dc=domain,dc=tld' filter => 'cn = *'
search found 0 users
No results found, no import
Finished import

But it is incorrect, there are 16 objects in that container:

$ ldapsearch -x -b "ou=users,dc=domain,dc=tld" -h host.domain.tld "(cn=*)" cn
....(lots of output with user dn and cn)
# numResponses: 17
# numEntries: 16

Am I doing something wrong? maybe the ldap filter in RT_SiteConfig.pm?
-- 
Groeten,
J.Asenjo



More information about the rt-users mailing list