ActiveDirectory integration logs in as client not agent

Moderator: crythias

Post Reply
krzyzak
Znuny newbie
Posts: 1
Joined: 01 Mar 2012, 17:05
Znuny Version: 31111
Real Name: Marcin
Company: none

ActiveDirectory integration logs in as client not agent

Post by krzyzak »

Hi,
i've installed the otrs on MS W2k3 form installer found on otrs page. I've adjusted the config to use ActiveDir db as a source of agents, and afer wanted also clients been loaded from same db. Unfortunately after first sync the user I used was loaded without admin permisions, since I couldn'd log in as admin, I deleted it from db (MSSQL) directly. Since that I can't login as that AD user. The error I get is:
[Thu Mar 1 15:59:56 2012][Notice][Kernel::System::User::GetUserData] Panic! No UserData for user id: '4'!!!
[Thu Mar 1 15:59:56 2012][Error][Kernel::System::User::Preferences::DB::SetPreferences][64] [Microsoft][ODBC SQL Server Driver][SQL Server]INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_user_preferences_user_id_id'. The conflict occurred in database 'otrs', table 'users', column 'id'. (SQL-23000) [state was 23000 now 01000]
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated. (SQL-01000), SQL: 'INSERT INTO user_preferences (user_id, preferences_key, preferences_value) VALUES (?, ?, ?)'
[Thu Mar 1 15:59:56 2012][Notice][Kernel::System::User::GetUserData] Panic! No UserData for user: 'name.surname'!!!
The Config I have is like that: (The idea was to create 2 groups in AD PL-G-HDAdmin, PL-G-HDUsers to insert into first Agents, second Clients, and load automatically to OTRS).

Code: Select all

 $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
 $Self->{'AuthModule::LDAP::Host'} = 'host.lan';
 $Self->{'AuthModule::LDAP::BaseDN'} = 'OU=Users,OU=Torun,DC=host,DC=lan';
 $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
 #$Self->{'AuthModule::LDAP::GroupDN'} = 'CN=PL-G-HDAdmin,OU=Groups,OU=Torun,DC=host,DC=lan';
 #$Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
 #$Self->{'AuthModule::LDAP::UserAttr'} = 'DN';
 $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=Name Surname,OU=Users,OU=Torun,DC=riello,DC=lan';
 $Self->{'AuthModule::LDAP::SearchUserPw'} = 'Password';
 
 $Self->{'AuthModule::LDAP::Params'} = {
	port => 389,
	timeout => 120,
	asunc => 0,
	version => 3,
	};
	
 $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
 $Self->{'AuthSyncModule::LDAP::Host'} = 'host.lan';
 $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'OU=Torun,DC=host,DC=lan';
 $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
 $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=Name Surname,OU=Users,OU=Torun,DC=host,DC=lan';
 $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'Password';
 $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
	UserFirstname => 'givenName',
	UserLastname => 'sn',
	UserEmail => 'mail',
	};
 $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = {
	'users',
	};
 $Self->{UserSyncLDAPMap} = {
	UserFirstname => 'givenName',
	UserLastname => 'sn',
	UserEmail => 'mail',
	};

 $Self->{UserSyncLDAPGroups} = {
	'users',
	};
	$Self->{DatabaseUserTable} = 'users';
	$Self->{DatabaseUserTableUserID} = 'id';
	$Self->{DatabaseUserTableUserPW} = 'pw';
	$Self->{DatabaseUserTableUser} = 'login';

Thanks for help.
Best regards
Marcin
Post Reply