Hi All,
I managed to install OTRS 3.0.4 and configure LDAP authentication for the agent. I've managed to see the list of customers with an external PostgreSQL database.
My question is: Is it possible to authenticate the customers with the external database?
Every time I try to log on as a customer, I get the following:
Jan 21 14:03:57 ca-mtl1-docs-01 OTRS-CGI-10[471]: [Notice][Kernel::System::CustomerAuth::DB::Auth] CustomerUser: No auth record in 'customer_user' for 'customerid' (REMOTE_ADDR: 10.10.XX.XX)
It tries to authenticate with OTRS own database. Here's relevent parts of my config:
$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = 'ldap.domain.com';
$Self->{'AuthModule::LDAP::BaseDN'} = 'OU=Users,OU=mtl01,DC=domain,DC=com';
$Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
$Self->{'AuthModule::LDAP::SearchUserDN'} = 'userid';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'pass';
$Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host'} = 'ldap://ldap.domain.com/';
$Self->{'AuthSyncModule::LDAP::BaseDN'} = 'ou=users, ou=mtl01, dc=domain, dc=com';
$Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'userid';
$Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'pass';
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
};
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
};
# CustomerUser (customer database backend and settings)
$Self->{CustomerUser} = {
Name => 'Fake Prod Database',
Module => 'Kernel::System::CustomerUser::DB',
Params => {
# if you want to use an external database, add the required settings
# DSN => 'DBI:odbc:yourdsn',
DSN => 'DBI:Pg:database=imetrik;host=db_host',
User => 'userid',
Password => 'pass',
Table => 'moonlight.user_base',
},
# customer unique id
CustomerKey => 'username',
# customer #
CustomerID => 'username',
CustomerValid => 'status',
CustomerUserListFields => ['first_name', 'last_name', 'email'],
CustomerUserSearchFields => ['first_name', 'last_name', 'username'],
CustomerUserSearchPrefix => '',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 250,
CustomerUserPostMasterSearchFields => ['email'],
CustomerUserNameFields => ['title','first_name','last_name'],
CustomerUserEmailUniqCheck => 1,
# # show not own tickets in customer panel, CompanyTickets
# CustomerUserExcludePrimaryCustomerID => 0,
# # generate auto logins
# AutoLoginCreation => 0,
# AutoLoginCreationPrefix => 'auto',
# # admin can change customer preferences
# AdminSetPreferences => 1,
# # cache time to live in sec. - cache any database queries
# CacheTTL => 0,
# # just a read only source
ReadOnly => 1,
Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, [ 'UserTitle', 'Title', 'title', 1, 0, 'var', '', 0 ],
[ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var', '', 0 ],
[ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var', '', 0 ],
[ 'UserLogin', 'Username', 'username', 1, 1, 'var', '', 0 ],
[ 'UserPassword', 'Password', 'password', 0, 0, 'var', '', 0 ],
[ 'UserEmail', 'Email', 'email', 1, 1, 'var', '', 0 ],
# [ 'UserEmail', 'Email', 'email', 1, 1, 'var', '$Env{"CGIHandle"}?Action=[ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
# [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 0, 'var', '', 0 ],
#[ 'UserPhone', 'Phone', 'phone', 1, 0, 'var', '', 0 ],
#[ 'UserFax', 'Fax', 'fax', 1, 0, 'var', '', 0 ],
#[ 'UserMobile', 'Mobile', 'mobile', 1, 0, 'var', '', 0 ],
#[ 'UserStreet', 'Street', 'street', 1, 0, 'var', '', 0 ],
#[ 'UserZip', 'Zip', 'zip', 1, 0, 'var', '', 0 ],
#[ 'UserCity', 'City', 'city', 1, 0, 'var', '', 0 ],
#[ 'UserCountry', 'Country', 'country', 1, 0, 'var', '', 0 ],
#[ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ],
[ 'ValidID', 'Valid', 'status', 0, 1, 'int', '', 0 ],
],
# default selections
Selections => {
UserTitle => {
'Mr.' => 'Mr.',
'Mrs.' => 'Mrs.',
},
},
};
Am I missing something? To change where the customer is authenticated?
Thanks,
-FB
OTRS External customer database
Moderator: crythias
[Solved] Re: OTRS External customer database
Woohoo!!!! It's works!
If anyone wants to know... Here's the solution to my problem:
$Self->{'Customer::AuthModule::DB::CryptType'} = 'plain';
$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::DB';
$Self->{'Customer::AuthModule::DB::Table'} = 'moonlight.user_base';
$Self->{'Customer::AuthModule::DB::CustomerKey'} = 'username';
$Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'password';
$Self->{'Customer::AuthModule::DB::DSN'} = "DBI:Pg:database=imetrik;host=dbhost";
$Self->{'Customer::AuthModule::DB::User'} = "userid";
$Self->{'Customer::AuthModule::DB::Password'} = "pass";
$Self->{'Customer::AuthModule::DB::CustomerID'} = 'id';
Also, I had to modify my Customer Map to add the user id for OTRS.
Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, [ 'UserTitle', 'Title', 'title', 1, 0, 'var', '', 0 ],
[ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var', '', 0 ],
[ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var', '', 0 ],
[ 'UserLogin', 'Username', 'username', 1, 1, 'var', '', 0 ],
[ 'UserPassword', 'Password', 'password', 0, 0, 'var', '', 0 ],
[ 'UserEmail', 'Email', 'email', 1, 1, 'var', '', 0 ],
[ 'UserCustomerID', 'CustomerID', 'id', 1, 1, 'var', '', 0 ],
# [ 'UserEmail', 'Email', 'email', 1, 1, 'var', '$Env{"CGIHandle"}?Action=[ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
[ 'UserCustomerIDs', 'CustomerIDs', 'id', 1, 0, 'var', '', 0 ],
#[ 'UserPhone', 'Phone', 'phone', 1, 0, 'var', '', 0 ],
#[ 'UserFax', 'Fax', 'fax', 1, 0, 'var', '', 0 ],
#[ 'UserMobile', 'Mobile', 'mobile', 1, 0, 'var', '', 0 ],
#[ 'UserStreet', 'Street', 'street', 1, 0, 'var', '', 0 ],
#[ 'UserZip', 'Zip', 'zip', 1, 0, 'var', '', 0 ],
#[ 'UserCity', 'City', 'city', 1, 0, 'var', '', 0 ],
#[ 'UserCountry', 'Country', 'country', 1, 0, 'var', '', 0 ],
#[ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ],
[ 'ValidID', 'Valid', 'status', 0, 1, 'int', '', 0 ],
],
That's it! Fully functionnal agent auth with LDAP and customer auth with an external PostgreSQL
Keep up the good work OTRS team!
-FB
If anyone wants to know... Here's the solution to my problem:
$Self->{'Customer::AuthModule::DB::CryptType'} = 'plain';
$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::DB';
$Self->{'Customer::AuthModule::DB::Table'} = 'moonlight.user_base';
$Self->{'Customer::AuthModule::DB::CustomerKey'} = 'username';
$Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'password';
$Self->{'Customer::AuthModule::DB::DSN'} = "DBI:Pg:database=imetrik;host=dbhost";
$Self->{'Customer::AuthModule::DB::User'} = "userid";
$Self->{'Customer::AuthModule::DB::Password'} = "pass";
$Self->{'Customer::AuthModule::DB::CustomerID'} = 'id';
Also, I had to modify my Customer Map to add the user id for OTRS.
Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, [ 'UserTitle', 'Title', 'title', 1, 0, 'var', '', 0 ],
[ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var', '', 0 ],
[ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var', '', 0 ],
[ 'UserLogin', 'Username', 'username', 1, 1, 'var', '', 0 ],
[ 'UserPassword', 'Password', 'password', 0, 0, 'var', '', 0 ],
[ 'UserEmail', 'Email', 'email', 1, 1, 'var', '', 0 ],
[ 'UserCustomerID', 'CustomerID', 'id', 1, 1, 'var', '', 0 ],
# [ 'UserEmail', 'Email', 'email', 1, 1, 'var', '$Env{"CGIHandle"}?Action=[ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
[ 'UserCustomerIDs', 'CustomerIDs', 'id', 1, 0, 'var', '', 0 ],
#[ 'UserPhone', 'Phone', 'phone', 1, 0, 'var', '', 0 ],
#[ 'UserFax', 'Fax', 'fax', 1, 0, 'var', '', 0 ],
#[ 'UserMobile', 'Mobile', 'mobile', 1, 0, 'var', '', 0 ],
#[ 'UserStreet', 'Street', 'street', 1, 0, 'var', '', 0 ],
#[ 'UserZip', 'Zip', 'zip', 1, 0, 'var', '', 0 ],
#[ 'UserCity', 'City', 'city', 1, 0, 'var', '', 0 ],
#[ 'UserCountry', 'Country', 'country', 1, 0, 'var', '', 0 ],
#[ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ],
[ 'ValidID', 'Valid', 'status', 0, 1, 'int', '', 0 ],
],
That's it! Fully functionnal agent auth with LDAP and customer auth with an external PostgreSQL

Keep up the good work OTRS team!
-FB