[Gelöst] LDAP mit ADS anbindung

Hilfe zu Znuny Problemen aller Art
Locked
zwarag
Znuny newbie
Posts: 3
Joined: 21 Feb 2012, 11:08
Znuny Version: version3

[Gelöst] LDAP mit ADS anbindung

Post by zwarag »

Ich versuche schon seit Donnerstag OTRS mit unserer ADS zu verbinden, und zwar so das ich die User nicht manuell eintragen muss und sie sich über LDAP anmelden.
Folgende Quellen habe ich für die Umsetzung benutzt:

http://www.youtube.com/watch?v=ZwODnB5L5lM
http://doc.otrs.org/3.0/de/html/custome ... ckend.html

Bitte entschuldigt dieses ausgekaute Thema, ich weis für einigen von euch muss es recht langweilig sein, aber für mich ist das mein erster Job und meine Kenntnisse sind noch nicht so tiefgehend.

Codemäßig siehts folgendermaßen aus:
Config.pm

Code: Select all

   $Self->{AuthModule1} = 'Kernel::System::Auth::LDAP';
	$Self->{'AuthModule::LDAP::Host1'} = 'philipp.firma.local';
	$Self->{'AuthModule::LDAP::BaseDN1'} = 'dc=firma,dc=local';
	$Self->{'AuthModule::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->{'AuthModule::LDAP::SearchUserDN1'} = 'CN=administrator,CN=Users,DC=firma,DC=local';
	$Self->{'AuthModule::LDAP::SearchUserPw1'} = '******';
	
	# 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,
	};
	
	# Die if backend can't work, e. g. can't connect to server.
	$Self->{'AuthModule::LDAP::Die1'} = 1;
	
	
	#------------------------- Async ---------------------#
   $Self->{AuthSyncModule1} = 'Kernel::System::Auth::Sync::LDAP';
	$Self->{'AuthSyncModule::LDAP::Host1'} = 'philipp.firma.local';
	$Self->{'AuthSyncModule::LDAP::BaseDN1'} = 'OU=Benutzer,OU=Firma,DC=firma,DC=local';
	$Self->{'AuthSyncModule::LDAP::UID1'} = 'sAMAccountName';
	
	$Self->{'AuthSyncModule::LDAP::SearchUserDN1'} = 'CN=administrator,CN=Users,DC=firma,DC=local';
	$Self->{'AuthSyncModule::LDAP::SearchUserPw1'} = '******';
  
	$Self->{'AuthSyncModule::LDAP::UserSyncMap1'} = {
	   # DB -> LDAP
	   UserFirstname => 'givenName',
	   UserLastname  => 'sn',
	   UserEmail     => 'mail',
	};
	
	# 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,
	};
	
    # Die if backend can't work, e. g. can't connect to server.
	 $Self->{'AuthSyncModule::LDAP::Die1'} = 1;
Die folgenden Fehlermeldungen konnte ich auslesen:
Can't load backend module Kernel::System::Auth::LDAP!
Can't locate Net/LDAP.pm in @INC (@INC contains: /opt/otrs-3.1.1/bin/Custom /opt/otrs-3.1.1/bin/Kernel/cpan-lib /opt/otrs-3.1.1/bin /opt/otrs-3.1.1/bin/cgi-bin/../../Custom /opt/otrs-3.1.1/bin/cgi-bin/../../Kernel/cpan-lib /opt/otrs-3.1.1/bin/cgi-bin/../.. /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /opt/otrs-3.1.1/bin/cgi-bin/../../Kernel/System/Auth/LDAP.pm line 16.
Daraufhin habe ich natürlich

Code: Select all

# perl -MCPAN -e shell
# i /Net::LDAP/
# install Bundle::Net::LDAP

Code: Select all

# perl -V
/etc/perl
/usr/local/lib/perl/5.10.1
/usr/local/share/perl/5.10.1
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl
Wenn ich dann versuche mich mit dem user otrs@firma.local anzumelden crashed die ganze Geschichte und 500er Fehlermeldung kommt.
Das ist alles was ich so zusammenschreiben konnte. Vl. kann mir jemand von euch ein paar tipps geben, wäre sehr dankbar dafür :)
Last edited by zwarag on 22 Feb 2012, 11:11, edited 1 time in total.
OS: Debian 6 on ESX
OTRS: 3.1.1
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: LDAP mit ADS anbindung

Post by ferrosti »

Füll bitte Deine Signatur bzgl. Version und OS aus!

Führe die Programme
otrs.DeleteCache.pl
otrs.LoaderCache.pl
otrs.RebuildConfig.pl
aus und starte danach den Webserver neu (vor allem dann wichtig, wenn er mit mod_perl läuft).
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
zwarag
Znuny newbie
Posts: 3
Joined: 21 Feb 2012, 11:08
Znuny Version: version3

Re: LDAP mit ADS anbindung

Post by zwarag »

das mit cache löschen hat ihm sicher gut getan :)

nun leider scheint es aber nicht wircklich auswirckungen gehabt zu haben
Feb 21 12:53:57 matthias OTRS-CGI-10[4282]: [Error][Kernel::System::Auth::new][Line:121]: Can't locate Net/LDAP.pm in @INC (@INC contains: /opt/otrs-3.1.1/bin/Custom /opt/otrs-3.1.1/bin/Kernel/cpan-lib /opt/otrs-3.1.1/bin /opt/otrs-3.1.1/bin/cgi-bin/../../Custom /opt/otrs-3.1.1/bin/cgi-bin/../../Kernel/cpan-lib /opt/otrs-3.1.1/bin/cgi-bin/../.. /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /opt/otrs-3.1.1/bin/cgi-bin/../../Kernel/System/Auth/LDAP.pm line 16.#012BEGIN failed--compilation aborted at /opt/otrs-3.1.1/bin/cgi-bin/../../Kernel/System/Auth/LDAP.pm line 16.
Feb 21 12:53:57 matthias OTRS-CGI-10[4282]: [Error][Kernel::System::Auth::new][Line:121]: Can't load backend module Kernel::System::Auth::LDAP!
wo finde ich die @INC variable? und/oder wieso checkt der nicht das LDAP.pm installiert ist? oder ist Net/LDAP.pm eine andere LDAP.pm?
OS: Debian 6 on ESX
OTRS: 3.1.1
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: LDAP mit ADS anbindung

Post by ferrosti »

Ich schätze, dass das Net::LDAP noch nicht richtig installiert ist.
Führ mal das
$OTRS_HOME/bin/otrs.CheckModules.pl
aus und schau Dir an, was da fehlt.
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
zwarag
Znuny newbie
Posts: 3
Joined: 21 Feb 2012, 11:08
Znuny Version: version3

Re: LDAP mit ADS anbindung

Post by zwarag »

Danke für deine hilfe ferrosti.
Tatsächlich lag es an der ganz einfach daran das die Net::LDAP nicht installiert war.

hatte es immer über

Code: Select all

# perl -MCPAN -e shell
# install Bundle::Net::LDAP 

versucht.
Das installierte auch immer fleisig aber otrs.CheckModules.pl sagte mir dann es sei immer noch nicht installiert sei.

erfolg brachte dann

Code: Select all

aptitude install libnet-ldap-perl
Würde mich freuen wenn du mir noch ganz kurz erklären könntest was da der unterschied ist?
OS: Debian 6 on ESX
OTRS: 3.1.1
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: [Gelöst] LDAP mit ADS anbindung

Post by ferrosti »

Ich kenne mich mit dem CPAN installer nicht aus. Normalerweise installiere ich Module über die Sourcen, auch wenn das umständlicher ist.
In Deinem Fall gehe ich aber davon aus, dass das Modul nicht richtig in Perls @INC Pfad lag.
1. Download the Perl module from CPAN or other site.
2. Extract the tarball.
3. Run perl Makefile.PL
4. Run make
5. Run make test
6. Run make install
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