After a lot of tinkering I have the following which *almost* works:
Code: Select all
$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = '1.2.3.4';
$Self->{'AuthModule::LDAP::BaseDN'} = 'o=org1';
$Self->{'AuthModule::LDAP::UID'} = 'uid';
$Self->{'AuthModule::LDAP::GroupDN'} = 'cn=OTRS_Agent,o=groups';
$Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
$Self->{'AuthModule::LDAP::SearchUserDN'} = 'cn=admin,o=servers';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'xxxxxxxxxxx';
$Self->{'AuthModule::LDAP::Params'} = {
port => 389,
timeout => 120,
async => 0,
version => 3,
SSCOPE => 'sub',
};
### org2 ###
$Self->{'AuthModule2'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host2'} = '1.2.3.4';
$Self->{'AuthModule::LDAP::BaseDN2'} = 'o=org2';
$Self->{'AuthModule::LDAP::UID2'} = 'uid';
$Self->{'AuthModule::LDAP::GroupDN2'} = 'cn=OTRS_Agent,o=groups';
$Self->{'AuthModule::LDAP::AccessAttr2'} = 'member';
$Self->{'AuthModule::LDAP::SearchUserDN2'} = 'cn=admin,o=servers';
$Self->{'AuthModule::LDAP::SearchUserPw2'} = 'xxxxxxxxxxx';
$Self->{'AuthModule::LDAP::Params2'} = {
port => 389,
timeout => 120,
async => 0,
version => 3,
SSCOPE => 'sub',
};
# agent data sync against ldap
$Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host'} = 'ldap://1.2.3.4/';
$Self->{'AuthSyncModule::LDAP::BaseDN'} = 'o=org1';
$Self->{'AuthSyncModule::LDAP::UID'} = 'uid';
$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'cn=admin,o=servers';
$Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'xxxxxxxxxxx';
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
};
$Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
'users',
];
$Self->{'AuthSyncModule2'} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host2'} = 'ldap://1.2.3.4/';
$Self->{'AuthSyncModule::LDAP::BaseDN2'} = 'o=org2';
$Self->{'AuthSyncModule::LDAP::UID2'} = 'uid';
$Self->{'AuthSyncModule::LDAP::SearchUserDN2'} = 'cn=admin,o=servers';
$Self->{'AuthSyncModule::LDAP::SearchUserPw2'} = 'xxxxxxxxxxx';
$Self->{'AuthSyncModule::LDAP::UserSyncMap2'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
};
$Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups2'} = [
'users',
];
$Self->{AuthModule3} = 'Kernel::System::Auth::DB';
$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host'} = '1.2.3.4';
$Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'o=org1';
$Self->{'Customer::AuthModule::LDAP::UID'} = 'uid';
$Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'UID';
$Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'cn=admin,o=servers';
$Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'xxxxxxxxxxx';
$Self->{'Customer::AuthModule::LDAP::Params'} = {
port => 389,
timeout => 120,
async => 0,
version => 3,
SSCOPE => 'sub',
};
The agent login works now, when someone is a member of the group they are allowed to log in.
Is it possible to merge the 2 agent backends somehow ?
The customer login is not working however, it is giving me the 'Panic, user authenticated but no user data can be found in OTRS DB!! Perhaps the user is invalid.' error which would mean there should be an authsyncmodule for customers as well but I can not find any reference for that.
After this works I can start securing things a little like not using our admin user for ldap authentication.