[solved] LDAP -> First bind failed, unexpected EOF

Hilfe zu Znuny Problemen aller Art
Locked
Phonon
Znuny newbie
Posts: 7
Joined: 12 Sep 2010, 18:22
Znuny Version: 3.0.10

[solved] LDAP -> First bind failed, unexpected EOF

Post by Phonon »

Guten Tag,

ich bin dabei eine otrs Installation an ein LDAD-Verzeichnis anzubinden und habe dazu etliche Beispielkonfigurationen schon durchprobiert. Allerdings erhalte ich immer wieder die Meldung (sowohl für Agent- als auch Customer-Anmeldung) in der apache error.log:

Code: Select all

Message: First bind failed! Unexpected EOF
Ganz offensichtlich funktioniert also etwas mit der Authentifizierung nicht. (Der LDAP-Server verlangt zudem eine Zertifizieung). Mein Ziel wäre es, dass sowohl Agents als auch Customer sich anmelden können, wenn sie im LDAP auftauchen und zusätzlich auch Agents die in der otrs database sind. Das System ist ein reines LDAP (kein MS AD) und es existieren keine Gruppen.

Der entsprechende Auszug aus der Config.pm:

Code: Select all

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #
    $Self->{'DatabaseHost'} = 'localhost';	# DatabaseHost
    $Self->{'Database'} = 'otrs';	# Database
    $Self->{'DatabaseUser'} = 'otrs';	# DatabaseUser
    $Self->{'DatabasePw'} = 'ein Passwort'; # DatabasePw You also can use bin/CryptPassword.pl for crypted passwords.)
    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};"; # DatabaseDSN, more: "man DBD::mysql"

	
	# ---------------------------------------------------- #
    # ldap settings                                        #
    # ---------------------------------------------------- #

##################
####Agent LDAP####
##################
$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = 'ldap.host.de';
$Self->{'AuthModule::LDAP::BaseDN'} = 'DC=TLD';
$Self->{'AuthModule::LDAP::UID'} = 'uid';
$Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=OTRS,OU=Auth-R,DC=LDAPManager,DC=TLD';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'Passwort';	

#LDAP:Params (Port, Version ...)
$Self->{'AuthModule::LDAP::Params'} =  {
	cafile => '/etc/ssl/certs/UGCHChain.pem',
	verify => 'required',
	async => '0',
	timeout => '120',
	version => '3',
	port => '636'
};

# agent data sync against ldap
$Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host'} = 'ldap.host.de'; # ldap host
$Self->{'AuthSyncModule::LDAP::BaseDN'} = 'DC=TLD';
$Self->{'AuthSyncModule::LDAP::UID'} = 'uid';
$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=OTRS,OU=Auth-R,DC=LDAPManager,DC=TLD';
$Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'Passwort';
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
    # DB -> LDAP
    UserFirstname => 'givenName',
    UserLastname  => 'sn',
    UserEmail     => 'mail',
	UserLogin => 'uid',
};
# AuthSyncModule::LDAP::UserSyncInitialGroups
# (sync following group with rw permission after initial create of first agent
# login)
$Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
    'users',
];
##################
##Customer LDAP###
##################
$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host'} = 'ldap.host.de'; # ldap host
$Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'DC=TLD';
$Self->{'Customer::AuthModule::LDAP::UID'} = 'uid';
$Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'CN=OTRS,OU=Auth-R,DC=LDAPManager,DC=TLD';
$Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'Passwort';

#LDAP:Params (Port, Version ...)
$Self->{'Customer::AuthModule::LDAP::Params'} = {
	cafile => '/etc/ssl/certs/UGCHChain.pem',
	verify => 'required',
    port => 636,
    timeout => 120,
    async => 0,
    version => 3,
};


# CustomerUser
# (customer ldap backend and settings)
$Self->{CustomerUser} = {
    Name => 'LDAP Data Source',
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
        Host => 'ldap.host.de', # ldap host
        BaseDN => 'DC=TLD', # ldap base dn
        SSCOPE => 'sub', # search scope (one|sub)
        UserDN => 'CN=OTRS,OU=Auth-R,DC=LDAPManager,DC=TLD',
        UserPw => 'Passwort',
        # in case you want to add always one filter to each ldap query, use
        # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
        AlwaysFilter => '',
            # if both your frontend and your LDAP are unicode, use this:
            SourceCharset => 'utf-8',
            DestCharset   => 'utf-8',
            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
                cafile => '/etc/ssl/certs/UGCHChain.pem',
				verify => 'required',
				port => 636,
                timeout => 120,
                async => 0,
                version => 3,
            },
    },
    CustomerKey => 'uid', # customer unique id
    # customer #
    CustomerID => 'mail',
    CustomerUserListFields => ['cn', 'mail'],
    CustomerUserSearchFields => ['uid', 'cn', 'mail'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 1000,
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['givenname', 'sn'],
    # show not own tickets in customer panel, CompanyTickets
    CustomerUserExcludePrimaryCustomerID => 0,
    # add an ldap filter for valid users (expert setting)
	# CustomerUserValidFilter => '(!(description=locked))',
    # administrator can't change customer preferences
    AdminSetPreferences => 0,
#    # cache time to live in sec. - cache any database queries
#    CacheTTL => 0,
    Map => [
        # note: Login, Email and CustomerID are mandatory!
        # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
        [ 'UserTitle',      '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 ],
    ],
};
Ich habe schon verschiedene Beispielekonfigurationen aus dem Forum probiert, doch nichts führte bisher zu dem erhofften Erfolg. Ich verlange keine vollständige Config; Hinweise woran es liegen könnte wären hingegen großartig.
Last edited by Phonon on 28 Sep 2011, 14:21, edited 1 time in total.
otrs 3.0.10
debian-squeezy
mysql & ldap
Lorenzo_Marschall
Znuny advanced
Posts: 106
Joined: 13 May 2011, 14:47
Znuny Version: 2.4 / 3.x
Real Name: Lorenzo Marschall
Company: bmsoft information technologies GmbH
Location: Germany, Italy
Contact:

Re: LDAP -> First bind failed, unexpected EOF

Post by Lorenzo_Marschall »

Phonon wrote: Ich habe schon verschiedene Beispielekonfigurationen aus dem Forum probiert, doch nichts führte bisher zu dem erhofften Erfolg. Ich verlange keine vollständige Config; Hinweise woran es liegen könnte wären hingegen großartig.
Was sagt ein grundsätzlicher Test von der Shell aus? Mit ldapsearch...
Zertifikat passt, ja?
OTRS + ITSM + PostgreSQL @ Debian
Phonon
Znuny newbie
Posts: 7
Joined: 12 Sep 2010, 18:22
Znuny Version: 3.0.10

Re: LDAP -> First bind failed, unexpected EOF

Post by Phonon »

Jap, ldapsearch liefert die richtigen Ergebnisse. Das Zertifikat habe ich direkt vom LDAP-Admin.
otrs 3.0.10
debian-squeezy
mysql & ldap
Phonon
Znuny newbie
Posts: 7
Joined: 12 Sep 2010, 18:22
Znuny Version: 3.0.10

Re: LDAP -> First bind failed, unexpected EOF

Post by Phonon »

Ich starte mal einen Doppelpost weil das Problem gelöst ist.

Die Lösung bestand darin, dass beim Host die komplette URI angegeben werden musste.

Anstatt

Code: Select all

ldap.host.de
musste da ein

Code: Select all

ldaps://ldap.host.de
hin.
otrs 3.0.10
debian-squeezy
mysql & ldap
Locked