Actually I have the following configuration to sync and authenticate users with our AD. but I want to use the "email" as a login. How to do that?
I tried to replace
byLogin => 'uid',
without luck.Login => 'mail',
Code: Select all
#################################################################
# Configuration for Active Directory #
#################################################################
#Begin of Agent AD conf
# This is a configuration for using an MS AD backend
$Self->{AuthModule1} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host1'} = 'UYDC01.domain.com';
$Self->{'AuthModule::LDAP::BaseDN1'} = 'OU=AMS,OU=Departments,DC=domain,DC=com';
$Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';
$Self->{'AuthModule::LDAP::AccessAttr1'} = 'member';
# User with permission to read from the LDAD tree
$Self->{'AuthModule::LDAP::SearchUserDN1'} = 'cn=otrs,OU=Service accounts,OU=AMS,DC=domain,DC=com';
$Self->{'AuthModule::LDAP::SearchUserPw1'} = 'somepass';
# This is a configuration for an LDAP auth sync. backend with AD
$Self->{AuthSyncModule1} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host1'} = 'UYDC01.domain.com';
$Self->{'AuthSyncModule::LDAP::BaseDN1'} = 'OU=AMS,OU=Departments,DC=domain,DC=com';
$Self->{'AuthSyncModule::LDAP::UID1'} = 'sAMAccountName';
$Self->{'AuthSyncModule::LDAP::AccessAttr1'} = 'member';
# User with permission to read from the LDAD tree
$Self->{'AuthSyncModule::LDAP::SearchUserDN1'} = 'cn=otrs,OU=Service accounts,OU=AMS,DC=domain,DC=com';
$Self->{'AuthSyncModule::LDAP::SearchUserPw1'} = 'somepass';
# Map if agent should create/synced from LDAP to DB after successful login
$Self->{'AuthSyncModule::LDAP::UserSyncMap1'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
Firstname => 'givenName',
UserTitle => 'description',
UserPhone => 'userAccountControl',
Email => 'mail',
Login => 'uid',
#Login => 'mail',
};
# This is to sync existing AD groups with OTRS Roles so permissions are assigne automatically
$Self->{'AuthSyncModule::LDAP::UserSyncRolesDefinition1'} = {
'CN=Technician,OU=AMS,DC=domain,DC=com' => {
# OTRS role
'Technician' => 1,
},
'CN=TAM,OU=AMS,DC=domain,DC=com' => {
# OTRS role
'TAM' => 1,
},
'CN=SD,OU=AMS,DC=domain,DC=com' => {
# OTRS role
'SD' => 1,
},
'CN=SDO,OU=AMS,DC=domain,DC=com' => {
# OTRS role
'SDO' => 1,
},
'CN=Customer Care,OU=AMS,DC=domain,DC=com' => {
# OTRS role
'Customer Care' => 1,
},
'CN=Compliance Team,OU=AMS,DC=domain,DC=com' => {
# OTRS role
'Compliance Team' => 1,
},
'CN=Team Leader,OU=AMS,DC=domain,DC=com' => {
# OTRS role
'TL' => 1,
},
};
# Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
$Self->{'AuthSyncModule::LDAP::Params1'} = {
port => 389,
timeout => 120,
async => 0,
version => 3,
};
#End of Agent AD conf
#Begin of Customer AD conf
#Enable LDAP authentication for Customers / Users
$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host'} = 'UYDC01.domain.com';
$Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'OU=Clients,OU=AMS,DC=domain,DC=com';
$Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
$Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'cn=otrs,OU=Service accounts,OU=AMS,DC=domain,DC=com';
$Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'somepassword';
# CustomerUser
# (customer user database backend and settings)
$Self->{CustomerUser} = {
Module => 'Kernel::System::CustomerUser::LDAP',
Name => 'domain AD',
Params => {
Host => 'UYDC01.domain.com',
BaseDN => 'OU=Clients,OU=AMS,DC=domain,DC=com',
SSCOPE => 'sub',
AlwaysFilter => '(objectclass=user)',
UserDN =>'cn=otrs,OU=Service accounts,OU=AMS,DC=domain,DC=com',
UserPw => 'somepass',
},
# customer unique id
CustomerKey => 'sAMAccountName',
# customer #
CustomerID => 'company',
CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'],
CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
CustomerUserSearchPrefix => '',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 250,
CustomerUserPostMasterSearchFields => ['mail'],
CustomerUserNameFields => ['givenname', 'sn'],
Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown, required, storage-type
#[ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
[ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
[ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
[ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
[ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
[ 'UserCustomerID', 'CustomerID', 'company', 0, 1, 'var' ],
[ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
#OBI AD password for customer users sync
[ 'OBIPassword', 'OBIPassword', 'protocolSettings', 1, 0, 'var' ],
#[ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
#[ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
],
};
#End of Customer AD conf
#################################################################
# Configuration for Active Directory #
#################################################################