Search code examples
authenticationldapdebianotrs

OTRS with LDAP authentication not working


I'm running OTRS 5s on my server and need to configure LDAP authentization in it.

currently i have this code:

$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = '127.0.0.1';
$Self->{'AuthModule::LDAP::BaseDN'} = 'dc=domain,dc=com';
$Self->{'AuthModule::LDAP::UID'} = 'uid';
$Self->{'AuthModule::LDAP::SearchUserDN'} = 'cn=tester,cn=adminuser,ou=users,dc=domain,dc=com';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'tester';

last two lines should be ok but I'm getting this error on site

Panic, user authenticated but no user data can be found in OTRS DB!! Perhaps the user is invalid.

I also tried version which I found here and on other sites, but thats not working at all with following code:

$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = '127.0.0.1';
$Self->{'AuthModule::LDAP::BaseDN'} = 'dc=domain,dc=com';
$Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
$Self->{'AuthModule::LDAP::GroupDN'} = 'cn=adminuser,ou=users,dc=domain,dc=com';
$Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
$Self->{'AuthModule::LDAP::UserAttr'} = 'DN';
$Self->{'AuthModule::LDAP::SearchUserDN'} = 'cn=tester,cn=adminuser,ou=users,dc=domain,dc=com';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'tester';

but it results in wrong password or username and apache error.log calling

ERROR: OTRS-CGI-45 Perl: 5.20.2 OS: linux Time: Mon Dec  5 18:19:41 2016
Message: No UserID found for 'tester'!

both codes have

$Self->{'AuthModule::LDAP::Params'} = {
    port => 389,
    timeout => 120,
    async => 0,
    version => 3,
};

Appreciate any help, thanks.


Solution

  • User (agents) need to exists in the database before you can use LDAP authentication for them. Add them manually or configure the AuthSyncModule module.