Использование LDAP-модуль для аутентификации Агентов

Пожалуйста, не создавайте здесь тем с вопросами!

Moderator: DenisBY

Locked
vikvik1
Znuny newbie
Posts: 3
Joined: 20 Apr 2011, 11:26
Znuny Version: 3.0.7
Real Name: vikvik1

Использование LDAP-модуль для аутентификации Агентов

Post by vikvik1 »

Для того, чтоб использовать доменные (Windows 2003 R2) учетные записи при авторизации Агентов в OTRS 3.0.7 необходимо в \OTRS\Kernel\Config.pm добавить следующий кусок конфига.
В АД необходимо создать OU=IT и группу Otrs_Agents. Члены этой OU и этой группы будут Агентами.

Так как вот тут http://doc.otrs.org/3.0/ru/html/auth-backends.html не совсем корректная информация - то выкладываю рабочий конфиг.
Особо обратить внимание на выделенные параметры. Они не такие как в документации и из-за них пример из документации не рабочий.

Для проверки на корректность всех данных, которые передаются ldap-серверу использую утилиту ldp.exe. С ее помощью необходимо убедится, что все CN, OU, DC существуют и они корректны и служебный пользователь Otrs O. Otrsuser имеет возможность читать эти данные.

# This is an example configuration for an LDAP auth. backend (Agents!!!).
# (take care that Net::LDAP is installed!) - корень дерева откуда начинаем просмотр АД
$Self->{AuthModule} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = 'ldap.firma.local';
$Self->{'AuthModule::LDAP::BaseDN'} = 'OU=IT,OU=Firma,DC=FIRMA,DC=LOCAL';
$Self->{'AuthModule::LDAP::UID'} = 'sn';

# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree - это учетка от имени которой ОТРС выполняет поиск по АД. Обязательно пароль должен быть неограничен по времени.
$Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=Otrs O. Otrsuser,OU=Tehnologicheskie,OU=Firma,DC=FIRMA,DC=LOCAL';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'Super_password';

# Check if the user is allowed to auth in a posixGroup
# (e. g. user needs to be in a group xyz to use otrs) - Чтобы стать Агентом необходимо быть членом доменной группы Otrs_Agents.
$Self->{'AuthModule::LDAP::GroupDN'} = 'CN=Otrs_Agents,OU=Firma,DC=FIRMA,DC=LOCAL';
$Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
# for ldap posixGroups objectclass (just uid)
$Self->{'AuthModule::LDAP::UserAttr'} = 'DN';
# for non ldap posixGroups objectclass (with full user dn)
#$Self->{'AuthModule::LDAP::UserAttr'} = 'DN';

# in case you want to add always one filter to each ldap query, use
# this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
$Self->{'AuthModule::LDAP::AlwaysFilter'} = '';

# in case you want to add a suffix to each login name, then
# you can use this option. e. g. user just want to use user but
# in your ldap directory exists user@domain.
# $Self->{'AuthModule::LDAP::UserSuffix'} = '@domain.com';

# In case you want to convert all given usernames to lower letters you
# should activate this option. It might be helpfull if databases are
# in use that do not distinguish selects for upper and lower case letters
# (Oracle, postgresql). User might be synched twice, if this option
# is not in use.
# $Self->{'AuthModule::LDAP::UserLowerCase'} = 0;

# In case you need to use OTRS in iso-charset, you can define this
# by using this option (converts utf-8 data from LDAP to iso).
$Self->{'AuthModule::LDAP::Charset'} = 'utf-8';

# Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
$Self->{'AuthModule::LDAP::Params'} = {
port => 389,
timeout => 120,
async => 0,
version => 3,
};

# Die if backend can't work, e. g. can't connect to server.
$Self->{'AuthModule::LDAP::Die'} = 1;

# --------------------------------------------------- #
# authentication sync settings #
# (enable agent data sync. after succsessful #
# authentication) #
# --------------------------------------------------- #
# This is an example configuration for an LDAP auth sync. backend.
# (take care that Net::LDAP is installed!) - Если Юзер зашел в ОТРС - то синхронизируем его параметры с локальной базой данных.
$Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host'} = '172.16.1.1';
$Self->{'AuthSyncModule::LDAP::BaseDN'} = 'OU=Firma,DC=FIRMA,DC=LOCAL';
$Self->{'AuthSyncModule::LDAP::UID'} = 'sn';

# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=Otrs O. Otrsuser,OU=Tehnologicheskie,OU=Firma,DC=FIRMA,DC=LOCAL';
$Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'Super_password';

# in case you want to add always one filter to each ldap query, use
# this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
$Self->{'AuthSyncModule::LDAP::AlwaysFilter'} = '';

# AuthSyncModule::LDAP::UserSyncMap
# (map if agent should create/synced from LDAP to DB after successful login) - описываем соответствие полей меджу атрибутами АД и локальной базой данных
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
};

# In case you need to use OTRS in iso-charset, you can define this
# by using this option (converts utf-8 data from LDAP to iso).
$Self->{'AuthSyncModule::LDAP::Charset'} = 'utf-8';

# Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
$Self->{'AuthSyncModule::LDAP::Params'} = {
port => 389,
timeout => 120,
async => 0,
version => 3,
};

# Die if backend can't work, e. g. can't connect to server.
# $Self->{'AuthSyncModule::LDAP::Die'} = 1;

# Attributes needed for group syncs
# (attribute name for group value key)
# $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'memberUid';
# (attribute for type of group content UID/DN for full ldap name)
# $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'UID';
# $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN';

# AuthSyncModule::LDAP::UserSyncInitialGroups
# (sync following group with rw permission after initial create of first agent login) - включаем в следующие группы с полными правами
$Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
'users', 'admin', 'faq_approval', 'faq_approval', 'faq_approval', 'faq_approval',
];
Locked