📜 ⬆️ ⬇️

OTRS: LDAP Authentication, Authorization, and Synchronization (FreeIPA, AD)

image

OTRS is an open-source open-source Ticket Request System, written in Perl.

There are two options:


I will list a little of the fact that this system supports:


And if you look for flaws in it - this is the unusual interface and the complexity of setting up. Under the cut - about the basics of authorization (group, RBAC, support for several client companies), authentication and synchronization of metadata (name, phone, etc.) using various LDAP directories

Clients, queues, agents and groups


After installing OTRS, you will be immediately available:


image

Standard groups


After installing the system, you will see three groups created:


Rights associated with groups


Basic rights


The basic rights that can be configured in the group, limiting the actions of agents:


Additional rights


There are also additional rights, the display of which can be enabled in the settings (System :: Permission):


Consider this in more detail:


image

Database Authentication


The standard way to authenticate and authorize agents and clients is the database.

For example, setting agent authentication using a database looks like this:

$Self->{'AuthModule'} = 'Kernel::System::Auth::DB'; 

Customers:

 $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::DB'; $Self->{'Customer::AuthModule::DB::Table'} = 'customer_user'; $Self->{'Customer::AuthModule::DB::CustomerKey'} = 'login'; $Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'pw'; 

We will also leave this authentication method and add LDAP authentication with it.

Roles and Companies


We will also expand authorization capabilities by adding roles and companies:


image

Formulation of the problem


You are the OTRS system administrator at my-it-company.com, which provides services to other companies (or divisions within your holding).

You really wouldn’t want to manually create accounts for new agents and clients, as well as fill out additional information, such as email address, phone number, position, address and account number - this is all already in LDAP directories.

And your company will also get obvious advantages - a single employee password to all systems, blocking an LDAP account will block access to all other services.

my-it-company.com runs on Linux and uses Red Hat FreeIPA as the directory server, and the departments you serve are various Microsoft Active Directory forests with which you do not have federation, but you can connect to domain controllers.

You need to separate the flow of requests from different clients, as well as implement different levels of agent access to the queues - managers should be able to change the priority of tasks in the system.

Employees of your company can also set tasks in the system for internal needs of my-it-company.com , sometimes being both agents and clients at the same time (and sometimes not).

image

Training


Accounts to view LDAP


If anonymous browsing of the directory tree is prohibited, then we will create accounts in the domains my-it-company.com , pear.com and macrohard.com whose rights are enough for us to make requests to LDAP (let's call them, for example, ldap-bot)

FreeIPA groups for synchronization with OTRS roles


Let's get three groups of users on FreeIPA that will be synchronized with our OTRS roles, for example:


Attribute that defines belonging to a company


Select the attribute by which we will determine the affiliation to the company. Let it be the attribute "Organization". For example, you did everything organizationally and technically, and all users in all domains always have a value in the "Organization" field:


Define user attributes used by FreeIPA


We study the FreeIPA scheme, finding out the names of the attributes that we need to synchronize (name, login, phone, etc.).

 kinit laptevs ipa user-show --all --raw laptevs 

We get a similar conclusion:
dn: uid = laptevs, cn = users, cn = accounts, dc = my-it-company, dc = com
uid: laptevs
givenname: Stanislav
sn: Laptev
cn: Laptev Stanislav
initials: SL
homedirectory: / home / laptevs
gecos: Laptev Stanislav
loginshell: / bin / sh
krbcanonicalname: laptevs@my-IT-COMPANY.COM
krbprincipalname: laptevs@my-IT-comPANY.COM
mail: laptevs@my-IT-COMPANY.COM
uidnumber: 1344600003
gidnumber: 1344600003
l: Moscow
telephonenumber: +7 (863) 999-99-99
mobile: +7 (999) 999-99-99
ou: My-it-company
title: SysAdm
sshpubkeyfp: SHA256: Yi8mKF + j28 / r2cpxLgIbvZ / Oymt57rhliHKhqBuJxqE laptevs-putty (ssh-rsa)
nsaccountlock: FALSE
has_password: TRUE
has_keytab: TRUE
displayName: Laptev Stanislav
ipaSshPubKey: c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBQkpRQUFBZ0VBNjQ1RTJjSjIvWXVVYm9GNzdZY3hLNzBndm1jWlgrZjBZTVpsaXRQVXNCWFZ0cENtTEtwcjRwK2JEeUdhRzNLTWx1T08ydW9wS0pXRk9mWE83Zzl3OTYzdklQblN3MzVHSmI3VGhhbk1pTXpNUE82T1lQZEY0em14b2k4N 0RGYkdXV2V6aGwzcitsbmFGYTB0dEQ5TkFWRU1Fb3BMdmkzcHZ1UXpyVmNjVlMxamFxY1dNT2ZGUC9TRlVoY1dGeVpZd3Z6eW0wWnZObUZtdjVjVHJGNzJMSXZOdHlsNkZGK2ZaU3ZpS01mcXZ6NStkT2xZZGd5bVVSOG5iaVpkTXZKaTIvbzhjTy84ekpoMFhtSnVRSjJXNEVvYVEvajVTTm8ySjZ6NklXNk I3cFB4Y002a0tJcUp5N08zTkNOcGRrVmVQbEFHbThsOFZDREpVa1RLSjRGOS9mSTZFUkhxVUZwK3p1VENTR1R3ZWlKdXppenFSZWJTTkNiMXh3RldmUitvYzFLdWNZSU5QbTYxRi93YXhOcC9aSG9OK2w1dCtkYWI4cElZSGZzTnNUNWx2RWt4Ukh0bnNyeUxsbWk1ZVdzd3RBbDB3TUpWd1cvUWNJcjhOaVN Ybm96Q3dHWTZCaTQ2L0FGTGVidmFLV0tKRmpKZFgxOFlRVDRpVzZGaE83aW40TGlUamlNaENXbStvbjNQbERYeXZpdkJ1WkFXUldXNEdjbXREVW8rSVhZT2t3MWh3UldqdkJtcExHMVZpMFhPckltbmQybTVZdWk1bHo0b1ZlekFRN1NjYVlrdDBoVEdQU1Z2UHpmVlowYWJCQlpiRmViK1hUV2tpSnBPMHBO T3dodGNadHYrN3RMMnc1OFN3QnhVTUk4NzUzdG5Sc1h1blBXZERqcUsxSDA9IGxhcHRldnMtcHV0dHk =
ipaUniqueID: 68d46dac-1d3c-11e9-82fd-0242ac110002
krbExtraData: AAL4VkVcbGFwdGV2c0BPTUlLUk9OLlBSTwA =
krbLastFailedAuth: 20190123084142Z
krbLastPwdChange: 20190121052200Z
krbLoginFailedCount: 0
krbPasswordExpiration: 20190421052200Z
memberof: cn = otrs-admins, cn = groups, cn = accounts, dc = my-it-company, dc = com
memberof: cn = ipausers, cn = groups, cn = accounts, dc = my-it-company, dc = com
mepManagedEntry: cn = laptevs, cn = groups, cn = accounts, dc = my-it-company, dc = com
objectClass: top
objectClass: person
objectClass: organizationalperson
objectClass: inetorgperson
objectClass: inetuser
objectClass: posixaccount
objectClass: krbprincipalaux
objectClass: krbticketpolicyaux
objectClass: ipaobject
objectClass: ipasshuser
objectClass: ipaSshGroupOfPubKeys
objectClass: mepOriginEntry

dn : uid = laptevs, cn = users, cn = accounts, dc = my-it-company, dc = com
uid : laptevs
givenname : Stanislav
sn : Laptev
cn : Laptev Stanislav
mail : laptevs@my-IT-COMPANY.COM
l : Moscow
telephonenumber : +7 (863) 999-99-99
mobile : +7 (999) 999-99-99
ou : My-it-company
title : SysAdm

OTRS configuration setup


Configuration files



Agent configuration


Agent Authentication


  # --------------------------------------------------- # # Agents authentication # # --------------------------------------------------- # # my-it-company.com LDAP backend $Self->{AuthModule} = 'Kernel::System::Auth::LDAP'; # Адрес LDAP-сервера $Self->{'AuthModule::LDAP::Host'} = 'my-it-company.com'; $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=my-it-company,dc=com'; $Self->{'AuthModule::LDAP::UID'} = 'uid'; # Блок нужен, только если запрещен анонимный просмотр структуры каталогов $Self->{'AuthModule::LDAP::SearchUserDN'} = 'uid=ldap-bot,cn=users,cn=accounts,dc=my-it-company,dc=com'; $Self->{'AuthModule::LDAP::SearchUserPw'} = 'bot-password!'; # Фильтр запроса к LDAP. Пусть у нас будут только пользователи, имеющие заполненный атрибут "электронная почта" $Self->{'AuthModule::LDAP::AlwaysFilter'} = '(mail=*)'; # Добавляем при проблемах с кодировкой $Self->{'AuthModule::LDAP::Charset'} = 'utf-8'; $Self->{'AuthModule::UseSyncBackend'} = 'AuthSyncBackend'; # my-it-company.com DB backend $Self->{AuthModule2} = 'Kernel::System::Auth::DB'; $Self->{'AuthModule::DB::CryptType2'} = 'sha2'; # --------------------------------------------------- # # End Agents authentication # # --------------------------------------------------- # 

Agent synchronization (LDAP groups with OTRS roles)


  # --------------------------------------------------- # # Agent authentication sync # # (enable agent data sync. after succsessful # # authentication) # # --------------------------------------------------- # # my-it-company.com LDAP auth sync. backend. $Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP'; $Self->{'AuthSyncModule::LDAP::Host'} = 'my-it-company.com'; $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=my-it-company,dc=com'; $Self->{'AuthSyncModule::LDAP::UID'} = 'uid'; $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'uid=ldap-bot,cn=users,cn=accounts,dc=my-it-company,dc=com'; $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'bot-password!'; $Self->{'AuthSyncModule::LDAP::AlwaysFilter'} = '(mail=*)'; $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = { # DB -> LDAP UserFirstname => 'givenName', UserLastname => 'sn', UserEmail => 'mail', }; $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'member'; $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN'; $Self->{'AuthSyncModule::LDAP::UserSyncRolesDefinition'} = { # ldap group 'cn=otrs-sa,cn=groups,cn=accounts,dc=my-it-company,dc=com' => { # otrs role 'otrs-sa' => 1, }, 'cn=otrs-admins,cn=groups,cn=accounts,dc=my-it-company,dc=com' => { 'otrs-admins' => 1, }, 'cn=otrs-helpdesk,cn=groups,cn=accounts,dc=my-it-company,dc=com' => { 'helpdesk' => 1, } }; $Self->{DatabaseUserTable} = 'users'; $Self->{DatabaseUserTableUserID} = 'id'; $Self->{DatabaseUserTableUserPW} = 'pw'; $Self->{DatabaseUserTableUser} = 'login'; # --------------------------------------------------- # # End Agents authentication sync # # --------------------------------------------------- # 

If you decide that the roles do not suit you, and you only want groups, I’ll give two examples of synchronizing LDAP groups with OTRS groups - simplified and with rights settings for each group.

Alternative synchronization of agents (LDAP groups with OTRS groups, with rights indicated)
  # --------------------------------------------------- # # Agent authentication sync # # (enable agent data sync. after succsessful # # authentication) # # --------------------------------------------------- # # my-it-company.com LDAP auth sync. backend. $Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP'; $Self->{'AuthSyncModule::LDAP::Host'} = 'my-it-company.com'; $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=my-it-company,dc=com'; $Self->{'AuthSyncModule::LDAP::UID'} = 'uid'; $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'uid=ldap-bot,cn=users,cn=accounts,dc=my-it-company,dc=com'; $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'bot-password!'; $Self->{'AuthSyncModule::LDAP::AlwaysFilter'} = '(mail=*)'; $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = { # DB -> LDAP UserFirstname => 'givenName', UserLastname => 'sn', UserEmail => 'mail', }; $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'member'; $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN'; # AuthSyncModule::LDAP::UserSyncGroupsDefinition # (If "LDAP" was selected for AuthModule and you want to sync LDAP # groups to otrs groups, define the following.) $Self->{'AuthSyncModule::LDAP::UserSyncGroupsDefinition'} = { # ldap group 'cn=otrs-admins,cn=groups,cn=accounts,dc=my-it-company,dc=com' => { # otrs group 'admin' => { # permission rw => 1, move_into => 1, create => 1, note => 1, owner => 1, prioriry => 1, ro => 1, }, 'stats' => { rw => 1, move_into => 1, create => 1, note => 1, owner => 1, prioriry => 1, ro => 1, }, 'users' => { rw => 1, move_into => 1, create => 1, note => 1, owner => 1, prioriry => 1, ro => 1, }, 'pear-group' => { rw => 1, move_into => 1, create => 1, note => 1, owner => 1, prioriry => 1, ro => 1, }, 'macrohard-group' => { rw => 1, move_into => 1, create => 1, note => 1, owner => 1, prioriry => 1, ro => 1, }, }, 'cn=otrs-helpdesk,cn=groups,cn=accounts,dc=my-it-company,dc=com' => { 'stats' => { rw => 1, move_into => 1, create => 1, note => 1, owner => 1, prioriry => 1, ro => 1, }, 'users' => { rw => 1, move_into => 1, create => 1, note => 1, owner => 1, prioriry => 1, ro => 1, }, } }; $Self->{DatabaseUserTable} = 'users'; $Self->{DatabaseUserTableUserID} = 'id'; $Self->{DatabaseUserTableUserPW} = 'pw'; $Self->{DatabaseUserTableUser} = 'login'; # --------------------------------------------------- # # End Agents authentication sync # # --------------------------------------------------- # 



Alternative simplified agent synchronization (LDAP groups with OTRS roles with rw rights)
  # --------------------------------------------------- # # Agent authentication sync # # (enable agent data sync. after succsessful # # authentication) # # --------------------------------------------------- # # my-it-company.com LDAP auth sync. backend. $Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP'; $Self->{'AuthSyncModule::LDAP::Host'} = 'my-it-company.com'; $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=my-it-company,dc=com'; $Self->{'AuthSyncModule::LDAP::UID'} = 'uid'; $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'uid=ldap-bot,cn=users,cn=accounts,dc=my-it-company,dc=com'; $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'bot-password!'; $Self->{'AuthSyncModule::LDAP::AlwaysFilter'} = '(mail=*)'; $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = { # DB -> LDAP UserFirstname => 'givenName', UserLastname => 'sn', UserEmail => 'mail', }; $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'member'; $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', ]; $Self->{DatabaseUserTable} = 'users'; $Self->{DatabaseUserTableUserID} = 'id'; $Self->{DatabaseUserTableUserPW} = 'pw'; $Self->{DatabaseUserTableUser} = 'login'; # --------------------------------------------------- # # End Agents authentication sync # # --------------------------------------------------- # 



Customer setup


Client Authentication


  # --------------------------------------------------- # # Сustomer authentication # # --------------------------------------------------- # # Сustomer DB auth. backend $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::DB'; $Self->{'Customer::AuthModule::DB::Table'} = 'customer_user'; $Self->{'Customer::AuthModule::DB::CustomerKey'} = 'login'; $Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'pw'; # my-it-company.com (Сustomer) LDAP auth. backend $Self->{'Customer::AuthModule2'} = 'Kernel::System::CustomerAuth::LDAP'; $Self->{'Customer::AuthModule::LDAP::Host2'} = 'my-it-company.com'; $Self->{'Customer::AuthModule::LDAP::BaseDN2'} = 'dc=my-it-company,dc=com'; $Self->{'Customer::AuthModule::LDAP::UID2'} = 'uid'; $Self->{'Customer::AuthModule::LDAP::SearchUserDN2'} = 'uid=ldap-bot,cn=users,cn=accounts,dc=my-it-company,dc=com'; $Self->{'Customer::AuthModule::LDAP::SearchUserPw2'} = 'bot-password!'; $Self->{'Customer::AuthModule::LDAP::AlwaysFilter2'} = '(mail=*)'; # pear LDAP auth. backend. $Self->{'Customer::AuthModule3'} = 'Kernel::System::CustomerAuth::LDAP'; $Self->{'Customer::AuthModule::LDAP::Host3'} = 'pear.com'; $Self->{'Customer::AuthModule::LDAP::BaseDN3'} = 'DC=pear,DC=com'; $Self->{'Customer::AuthModule::LDAP::UID3'} = 'sAMAccountName'; $Self->{'Customer::AuthModule::LDAP::SearchUserDN3'} = 'ldap-bot@pear.com'; $Self->{'Customer::AuthModule::LDAP::SearchUserPw3'} = 'bot-password?'; # Отфильтруем: (mail=*) - у кого есть почта и (samAccountType=805306368) - учетная запись пользователя и (!(userAccountControl:1.2.840.113556.1.4.803:=2)) - не отключена $Self->{'Customer::AuthModule::LDAP::AlwaysFilter3'} = '(&(mail=*)(samAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'; # macrohard LDAP auth. backend. $Self->{'Customer::AuthModule4'} = 'Kernel::System::CustomerAuth::LDAP'; $Self->{'Customer::AuthModule::LDAP::Host4'} = 'macrohard.com'; $Self->{'Customer::AuthModule::LDAP::BaseDN4'} = 'dc=macrohard,dc=com'; $Self->{'Customer::AuthModule::LDAP::UID4'} = 'sAMAccountName'; $Self->{'Customer::AuthModule::LDAP::SearchUserDN4'} = 'ldap-bot@macrohard.com'; $Self->{'Customer::AuthModule::LDAP::SearchUserPw4'} = 'bot-password!?'; $Self->{'Customer::AuthModule::LDAP::AlwaysFilter4'} = '(&(mail=*)(samAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'; # --------------------------------------------------- # # End customer authentication settings # # --------------------------------------------------- # 

Client synchronization (obtaining client attributes from LDAP, communication with OTRS companies)


  # --------------------------------------------------- # # Customer authentication sync # # --------------------------------------------------- # # Customer user DB backend and settings $Self->{CustomerUser} = { Name => Translatable('Database Backend'), Module => 'Kernel::System::CustomerUser::DB', Params => { Table => 'customer_user', SearchCaseSensitive => 0, }, # customer unique id CustomerKey => 'login', # customer # CustomerID => 'customer_id', CustomerValid => 'valid_id', CustomerUserListFields => [ 'first_name', 'last_name', 'email' ], CustomerUserSearchFields => [ 'login', 'first_name', 'last_name', 'customer_id' ], CustomerUserSearchPrefix => '*', CustomerUserSearchSuffix => '*', CustomerUserSearchListLimit => 250, CustomerUserPostMasterSearchFields => ['email'], CustomerUserNameFields => [ 'title', 'first_name', 'last_name' ], CustomerUserEmailUniqCheck => 1, CustomerCompanySupport => 1, CacheTTL => 60 * 60 * 24, Map => [ [ 'UserTitle', Translatable('Title or salutation'), 'title', 1, 0, 'var', '', 0, undef, undef ], [ 'UserFirstname', Translatable('Firstname'), 'first_name', 1, 1, 'var', '', 0, undef, undef ], [ 'UserLastname', Translatable('Lastname'), 'last_name', 1, 1, 'var', '', 0, undef, undef ], [ 'UserLogin', Translatable('Username'), 'login', 1, 1, 'var', '', 0, undef, undef ], [ 'UserPassword', Translatable('Password'), 'pw', 0, 0, 'var', '', 0, undef, undef ], [ 'UserEmail', Translatable('Email'), 'email', 1, 1, 'var', '', 0, undef, undef ], [ 'UserCustomerID', Translatable('CustomerID'), 'customer_id', 0, 1, 'var', '', 0, undef, undef ], [ 'UserPhone', Translatable('Phone'), 'phone', 1, 0, 'var', '', 0, undef, undef ], [ 'UserFax', Translatable('Fax'), 'fax', 1, 0, 'var', '', 0, undef, undef ], [ 'UserMobile', Translatable('Mobile'), 'mobile', 1, 0, 'var', '', 0, undef, undef ], [ 'UserStreet', Translatable('Street'), 'street', 1, 0, 'var', '', 0, undef, undef ], [ 'UserZip', Translatable('Zip'), 'zip', 1, 0, 'var', '', 0, undef, undef ], [ 'UserCity', Translatable('City'), 'city', 1, 0, 'var', '', 0, undef, undef ], [ 'UserCountry', Translatable('Country'), 'country', 1, 0, 'var', '', 0, undef, undef ], [ 'UserComment', Translatable('Comment'), 'comments', 1, 0, 'var', '', 0, undef, undef ], [ 'ValidID', Translatable('Valid'), 'valid_id', 0, 1, 'int', '', 0, undef, undef ], ], # default selections Selections => { # UserTitle => { # 'Mr.' => Translatable('Mr.'), # 'Mrs.' => Translatable('Mrs.'), # }, }, }; # my-it-company.com customer user ldap backend and settings $Self->{CustomerUser2} = { Name => 'AD my-it-company.com', Module => 'Kernel::System::CustomerUser::LDAP', Params => { # ldap host Host => 'my-it-company.com', # ldap base dn BaseDN => 'dc=my-it-company,dc=com', # search scope (one|sub) SSCOPE => 'sub', UserDN => 'uid=ldap-bot,cn=users,cn=accounts,dc=my-it-company,dc=com', UserPw => 'bot-password!', # in case you want to add always one filter to each ldap query, use # this option. eg AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)' AlwaysFilter => '(mail=*)', SourceCharset => 'utf-8', Die => 0, }, # customer unique id CustomerKey => 'uid', # customer # CustomerID => 'ou', CustomerUserListFields => ['uid', 'cn', 'mail'], CustomerUserSearchFields => ['uid', 'cn', 'mail'], CustomerUserSearchPrefix => '', CustomerUserSearchSuffix => '*', CustomerUserSearchListLimit => 250, CustomerUserPostMasterSearchFields => ['mail'], CustomerUserNameFields => ['sn', 'givenname'], # Configures the character for joining customer user name parts. Join single space if it is not defined. CustomerUserNameFieldsJoin => ' ', # show customer user and customer tickets in customer interface CustomerUserExcludePrimaryCustomerID => 0, # add a ldap filter for valid users (expert setting) # CustomerUserValidFilter => '(!(description=gesperrt))', # admin can't change customer preferences AdminSetPreferences => 1, # cache time to live in sec. - cache any ldap queries CacheTTL => 0, Map => [ [ 'UserTitle', Translatable('Title or salutation'), 'title', 1, 0, 'var', '', 1, undef, undef ], [ 'UserFirstname', Translatable('Firstname'), 'givenname', 1, 1, 'var', '', 1, undef, undef ], [ 'UserLastname', Translatable('Lastname'), 'sn', 1, 1, 'var', '', 1, undef, undef ], [ 'UserLogin', Translatable('Username'), 'uid', 1, 1, 'var', '', 1, undef, undef ], [ 'UserEmail', Translatable('Email'), 'mail', 1, 1, 'var', '', 1, undef, undef ], [ 'UserCustomerID', Translatable('CustomerID'), 'ou', 0, 1, 'var', '', 1, undef, undef ], [ 'UserPhone', Translatable('Phone'), 'telephonenumber', 1, 0, 'var', '', 1, undef, undef ], [ 'UserMobile', Translatable('Mobile'), 'mobile', 1, 0, 'var', '', 1, undef, undef ], ], }; # pear customer user ldap backend and settings $Self->{CustomerUser3} = { Name => 'AD pear', Module => 'Kernel::System::CustomerUser::LDAP', Params => { # ldap host Host => 'pear.com', BaseDN => 'DC=pear,DC=com', SSCOPE => 'sub', UserDN => 'ldap-bot@pear.com', UserPw => 'bot-password?', AlwaysFilter => '(&(mail=*)(samAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', SourceCharset => 'utf-8', Die => 0, }, # customer unique id CustomerKey => 'sAMAccountName', # customer # CustomerID => 'company', CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'], CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'], CustomerUserSearchPrefix => '', CustomerUserSearchSuffix => '*', CustomerUserSearchListLimit => 250, CustomerUserPostMasterSearchFields => ['mail'], CustomerUserNameFields => ['sn', 'givenname'], # Configures the character for joining customer user name parts. Join single space if it is not defined. CustomerUserNameFieldsJoin => ' ', # show customer user and customer tickets in customer interface CustomerUserExcludePrimaryCustomerID => 0, AdminSetPreferences => 1, CacheTTL => 0, Map => [ # note: Login, Email and CustomerID needed! # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target, link class(es) [ 'UserTitle', Translatable('Title or salutation'), 'title', 1, 0, 'var', '', 1, undef, undef ], [ 'UserFirstname', Translatable('Firstname'), 'givenname', 1, 1, 'var', '', 1, undef, undef ], [ 'UserLastname', Translatable('Lastname'), 'sn', 1, 1, 'var', '', 1, undef, undef ], [ 'UserLogin', Translatable('Username'), 'sAMAccountName', 1, 1, 'var', '', 1, undef, undef ], [ 'UserFullLogin', Translatable('FullUsername'), 'userPrincipalName', 1, 1, 'var', '', 1, undef, undef ], [ 'UserEmail', Translatable('Email'), 'mail', 1, 1, 'var', '', 1, undef, undef ], [ 'UserCustomerID', Translatable('CustomerID'), 'company', 0, 1, 'var', '', 1, undef, undef ], [ 'UserPhone', Translatable('Phone'), 'telephoneNumber', 1, 0, 'var', '', 1, undef, undef ], [ 'UserMobile', Translatable('Mobile'), 'mobile', 1, 0, 'var', '', 1, undef, undef ], [ 'UserAddress', Translatable('Address'), 'postaladdress', 1, 0, 'var', '', 1, undef, undef ], [ 'UserOffice', Translatable('Office'), 'physicalDeliveryOfficeName', 1, 0, 'var', '', 1, undef, undef ], [ 'UserDepartment', Translatable('Department'), 'department', 1, 0, 'var', '', 1, undef, undef ], [ 'UserComment', Translatable('Comment'), 'description', 1, 0, 'var', '', 1, undef, undef ], ], }; # macrohard customer user ldap backend and settings $Self->{CustomerUser4} = { Name => 'AD macrohard', Module => 'Kernel::System::CustomerUser::LDAP', Params => { # ldap host Host => 'macrohard.com', # ldap base dn BaseDN => 'dc=macrohard,dc=com', # search scope (one|sub) SSCOPE => 'sub', UserDN => 'ldap-bot@macrohard.com', UserPw => 'bot-password!?', AlwaysFilter => '(&(mail=*)(samAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', SourceCharset => 'utf-8', Die => 0, }, # customer unique id CustomerKey => 'sAMAccountName', # customer # CustomerID => 'company', CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'], CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'], CustomerUserSearchPrefix => '', CustomerUserSearchSuffix => '*', CustomerUserSearchListLimit => 250, CustomerUserPostMasterSearchFields => ['mail'], CustomerUserNameFields => ['sn', 'givenname'], # Configures the character for joining customer user name parts. Join single space if it is not defined. CustomerUserNameFieldsJoin => ' ', # show customer user and customer tickets in customer interface CustomerUserExcludePrimaryCustomerID => 0, AdminSetPreferences => 1, CacheTTL => 0, Map => [ [ 'UserTitle', Translatable('Title or salutation'), 'title', 1, 0, 'var', '', 1, undef, undef ], [ 'UserFirstname', Translatable('Firstname'), 'givenname', 1, 1, 'var', '', 1, undef, undef ], [ 'UserLastname', Translatable('Lastname'), 'sn', 1, 1, 'var', '', 1, undef, undef ], [ 'UserLogin', Translatable('Username'), 'sAMAccountName', 1, 1, 'var', '', 1, undef, undef ], [ 'UserFullLogin', Translatable('FullUsername'), 'userPrincipalName', 1, 1, 'var', '', 1, undef, undef ], [ 'UserEmail', Translatable('Email'), 'mail', 1, 1, 'var', '', 1, undef, undef ], [ 'UserCustomerID', Translatable('CustomerID'), 'company', 0, 1, 'var', '', 1, undef, undef ], [ 'UserPhone', Translatable('Phone'), 'telephoneNumber', 1, 0, 'var', '', 1, undef, undef ], [ 'UserMobile', Translatable('Mobile'), 'mobile', 1, 0, 'var', '', 1, undef, undef ], [ 'UserAddress', Translatable('Address'), 'postaladdress', 1, 0, 'var', '', 1, undef, undef ], [ 'UserOffice', Translatable('Office'), 'physicalDeliveryOfficeName', 1, 0, 'var', '', 1, undef, undef ], [ 'UserDepartment', Translatable('Department'), 'department', 1, 0, 'var', '', 1, undef, undef ], [ 'UserComment', Translatable('Comment'), 'description', 1, 0, 'var', '', 1, undef, undef ], ], }; 

Conclusion


As you have seen, setting up authentication and synchronization of accounts in OTRS is very simple, but still I hope that this article will help those who are just starting to get acquainted with this system.

What is left behind this article?


Tips and clarifications are welcome comments, information about typos - in drugs.

Thanks for attention. Special thanks to the authors whose materials on OTRS I used many years ago when meeting this system: Turilion , supersuperoleg , wmlex

Source: https://habr.com/ru/post/437596/