OTRS LDAP configuration

Moderator: crythias

Locked
Swastik
Znuny newbie
Posts: 4
Joined: 06 Mar 2012, 13:45
Znuny Version: OTRS3
Real Name: Swastik
Company: FuelPlus

OTRS LDAP configuration

Post by Swastik »

Hello all,

I am customizing the OTRS config.pm file to connect it with windows Active Directory.
With this code I can login OTRS agent interface but I can not add the customers as an admin user to the customer list.
Could anyone help me out here.
-->How can I add the customers in OTRS with my Active Directory integration?

Here is my code:
# This is an example configuration for an LDAP auth. backend.
# (take care that Net::LDAP is installed!)
$Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host1'} = 'abc';
$Self->{'AuthModule::LDAP::BaseDN1'} = 'dc=example,dc=com';
$Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';


$Self->{'AuthModule::LDAP::SearchUserDN1'} = 'CN=ORTS SEARCH,CN=Users,DC=example,DC=com';
$Self->{'AuthModule::LDAP::SearchUserPw1'} = 'Luckyguy$01';

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


# --------------------------------------------------- #
# 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->{'AuthSyncModule1'} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host1'} = 'abc';
$Self->{'AuthSyncModule::LDAP::BaseDN1'} = 'dc=example,dc=com';
$Self->{'AuthSyncModule::LDAP::UID1'} = '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->{'AuthSyncModule::LDAP::SearchUserDN1'} = 'CN=ORTS SEARCH,CN=Users,DC=example,DC=com';
$Self->{'AuthSyncModule::LDAP::SearchUserPw1'} = 'Luckyguy$01';


# AuthSyncModule::LDAP::UserSyncMap
# (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',
};


# This is an example configuration for an LDAP auth. backend.
# (take care that Net::LDAP is installed!)
$Self->{'Customer::AuthModule1'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host1'} = 'abc';
$Self->{'Customer::AuthModule::LDAP::BaseDN1'} = 'dc=example,dc=com';
$Self->{'Customer::AuthModule::LDAP::UID1'} = 'sAMAcountName';

$Self->{'Customer::AuthModule::LDAP::SearchUserDN1'} = 'CN=ORTS SEARCH,CN=Users,DC=example,DC=com';
$Self->{'Customer::AuthModule::LDAP::SearchUserPw1'} = 'password';

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

$Self->{CustomerUser} = {
Name => 'data source',
Module => 'Kernel::System::CustomerUser::LDAP',
Params => {
Host => 'abc',
BaseDN => 'dc=example,dc=com',
SSCOPE => 'sub',
UserDN => 'CN=OTRS Search,cn=notify,ou=Users,DC=example,DC=com',
UserPw => 'password',
AlwaysFilter => '',
Params => {
port => 389,
timeout => 120,
async => 0,
version => 3,
},
},
CustomerKey => 'sAMAccountName',
CustomerID => 'mail',
CustomerUserListFields => ['cn', 'mail'],
CustomerUserSearchFields => ['uid', 'cn', 'mail'],
CustomerUserSearchListLimit => 250,
CustomerUserPostMasterSearchFields => ['mail'],
CustomerUserNameFields => ['givenname', 'sn'],
CustomerUserExcludePrimaryCustomerID => 0,
AdminSetPreferences => 0,
Map => [
[ 'UserSalutation', 'Title', 'title', 1, 0,'var', '', 0 ],
[ 'UserFirstname', 'Firstname', 'givenname', 1, 1,'var', '', 0 ],
[ 'UserLastname', 'Lastname', 'sn', 1, 1,'var', '', 0 ],
[ 'UserLogin', 'Username', 'uid', 1, 1,'var', '', 0 ],
[ 'UserEmail', 'Email', 'mail', 1, 1,'var', '', 0 ],
[ 'UserCustomerID', 'CustomerID', 'mail', 0, 1,'var', '', 0 ],
[ 'UserPhone', 'Phone', 'telephonenumber', 1, 0,'var', '', 0 ],
[ 'UserAddress', 'Address', 'postaladdress', 1, 0,'var', '', 0 ],
[ 'UserComment', 'Comment', 'description', 1, 0,'var', '', 0 ],
],
};

Thanks in advance.
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: OTRS LDAP configuration

Post by ferrosti »

Try this one

Code: Select all

CustomerKey => 'samaccountname',
CustomerID => 'mail',
CustomerUserListFields => ['cn', 'mail'],
CustomerUserSearchFields => ['samaccountname', 'cn', 'mail'],
CustomerUserSearchPrefix => '',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 250,
CustomerUserPostMasterSearchFields => ['mail'],
CustomerUserNameFields => ['givenname', 'sn'],
and

Code: Select all

[ 'UserLogin',      'Username',   'samaccountname',  1, 1, 'var', '', 0 ],
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Swastik
Znuny newbie
Posts: 4
Joined: 06 Mar 2012, 13:45
Znuny Version: OTRS3
Real Name: Swastik
Company: FuelPlus

Re: OTRS LDAP configuration

Post by Swastik »

Hello Ferrosti,

Thanks for the reply.
But still I can not login to the Customer.pl page with my Active Directory credentials.
Do you have any other solution?
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: OTRS LDAP configuration

Post by ferrosti »

Please post your log and edit your signature about version, OS, etc.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Swastik
Znuny newbie
Posts: 4
Joined: 06 Mar 2012, 13:45
Znuny Version: OTRS3
Real Name: Swastik
Company: FuelPlus

Re: OTRS LDAP configuration

Post by Swastik »

Hello Ferrosti,

I am using OTRS 3.1 version and this is the error in my log file


[Fri Mar 16 10:44:50 2012][Notice][main::_AutoRestart] Scheduler service is stopping due a restart.
[Fri Mar 16 10:45:21 2012][Notice][main::_start] Scheduler Service is starting...!
[Fri Mar 16 10:45:22 2012][Notice][main::_start] Scheduler Service start! PID 552
[Fri Mar 16 10:45:24 2012][Error][Kernel::System::PID::PIDGet][181] MySQL server has gone away, SQL: 'SELECT process_name, process_id, process_host, process_create, process_change FROM process_id WHERE process_name = ?'
[Fri Mar 16 10:45:24 2012][Error][Kernel::System::PID::PIDGet][181] MySQL server has gone away, SQL: 'SELECT process_name, process_id, process_host, process_create, process_change FROM process_id WHERE process_name = ?'
[Fri Mar 16 10:45:24 2012][Error][Kernel::System::PID::PIDUpdate][249] Can not get PID
[Fri Mar 16 10:45:24 2012][Error][Kernel::Scheduler::_PIDChangedTimeUpdate][331] Could not update PID
[Fri Mar 16 10:45:24 2012][Error][Kernel::System::Scheduler::TaskManager::TaskList][278] MySQL server has gone away, SQL: 'SELECT id, task_type, due_time FROM scheduler_task_list ORDER BY create_time, id ASC'
[Fri Mar 16 10:45:25 2012][Error][Kernel::System::PID::PIDGet][181] MySQL server has gone away, SQL: 'SELECT process_name, process_id, process_host, process_create, process_change FROM process_id WHERE process_name = ?'
[Fri Mar 16 10:45:26 2012][Error][Kernel::System::DB::new][227] Can't connect to MySQL server on 'localhost' (10061)
[Fri Mar 16 10:45:39 2012][Error][C:/PROGRA~1/OTRS/OTRS/bin/otrs.Scheduler4win.pl][236] Scheduler Service tries to start but found an already running service!

[Fri Mar 16 10:46:15 2012][Notice][Kernel::System::CustomerAuth::DB::Auth] CustomerUser: No auth record in 'customer_user' for 'abc' (REMOTE_ADDR: XXX.0.0.XX)
[Fri Mar 16 10:46:38 2012][Notice][Kernel::System::CustomerAuth::DB::Auth] CustomerUser: No auth record in 'customer_user' for 'abc@example.com' (REMOTE_ADDR: 127.0.0.1)
[Fri Mar 16 10:46:45 2012][Notice][Kernel::System::CustomerAuth::DB::Auth] CustomerUser: No auth record in 'customer_user' for 'abc' (REMOTE_ADDR: 127.0.0.1)
[Fri Mar 16 10:46:57 2012][Error][Kernel::System::Email::Sendmail::Send][68] No such binary: /usr/sbin/sendmail!
[Fri Mar 16 10:46:57 2012][Info][Kernel::System::Email::Send] Error sending message
[Fri Mar 16 10:47:05 2012][Error][Kernel::System::Email::Sendmail::Send][68] No such binary: /usr/sbin/sendmail!
[Fri Mar 16 10:47:05 2012][Info][Kernel::System::Email::Send] Error sending message
[Fri Mar 16 10:47:16 2012][Notice][Kernel::System::Auth::DB::Auth] User: root@localhost authentication ok (REMOTE_ADDR: 127.0.0.1).
[Fri Mar 16 10:51:01 2012][Error][Kernel::System::MailAccount::POP3::Fetch][128] POP3: Can't connect to ExchangeServer


It says that I do not have authentication record for Customers but my OTRS is connected with Active Directory and working for the agent interface.
Do you have any idea what is the problem?

Regards,
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: OTRS LDAP configuration

Post by ferrosti »

Your log says, that it tries to auth your customers against DB, not LDAP.
[Kernel::System::CustomerAuth::DB::Auth]

There must be some other configuration in your file regarding DB auth for customers, that should be disabled. Also make sure to have Auth and Sync sequence at the same number.
$Self->{'Customer::AuthModule1'}
$Self->{CustomerUser1}
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Swastik
Znuny newbie
Posts: 4
Joined: 06 Mar 2012, 13:45
Znuny Version: OTRS3
Real Name: Swastik
Company: FuelPlus

Re: OTRS LDAP configuration

Post by Swastik »

Hello Ferrosti,

Thanks a lot. Now it is working.
I have one more question......
How can I delete tickets on Customer.pl interface.

Regards,
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: OTRS LDAP configuration

Post by ferrosti »

Tickets are not to be deleted, but closed only!
Play a litte with 'Closed' status in Customer View.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Locked