[gelöst] LDAP SSL - First bind failed!

Hilfe zu OTRS Problemen aller Art
Post Reply
Attack44
Znuny newbie
Posts: 2
Joined: 19 Jul 2022, 15:43
Znuny Version: 6.3.4
Real Name: Andreas

[gelöst] LDAP SSL - First bind failed!

Post by Attack44 »

Hallo,

ich bin gerade dabei die DLAP Anbindung/Synchronisation in Znuny zu konfigurieren. Es gibt ja viele Anleitung und Codebeispiele die man dafür verwenden kann, nur leider komme ich aktuell nicht weiter.

Ich habe die Konfiguration denke ich weitestgehend richtig angepasst mit Sicherheitsgruppen usw., wenn sich aber ein Agent das erste Mal versucht anzumelden erscheint folgende Fehlermeldung: "Authentifizierung erfolgreich, aber in der Datenbank wurde kein Eintrag für den Benutzer gefunden. Bitte kontaktieren Sie Ihren Administrator." Gebe ich mit Absicht ein falsches Passwort ein, wird mir das auch angezeigt.

Im Systemprotokoll tauchen dann folgende Meldungen auf:
- First bind failed! 80090308: LdapErr: DSID-0C090447, comment: AcceptSecurityContext error, data 57, v3839
- No UserID found for 'TestUser'!

Code: Select all

    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = 'ldaps://x.x.x.x'; # we use secure LDAP, so ldaps: instead of ldap:
    $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=firma,dc=local';
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName'; # Im guessing that Microsoft AD uses 'sAMAccountName'

    # Check if the user is allowed to auth in a posixGroup
    $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=DL_OTRS_USERS,OU=Systemordner,OU=IT,OU=Zentrale,DC=firma,DC=local';
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';

    # Bind credentials to log into AD
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'ldapread@firma.local';
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'Password';

    # in case you want to add always one filter to each ldap query, use
    # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
    $Self->{'AuthModule::LDAP::AlwaysFilter'} = '';     # No filter until you get it to work

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

   # Now sync data with OTRS DB
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'ldaps://192.168.0.1';              # we use secure LDAP, so ldaps: instead of ldap:
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=firma, dc=local';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'UID';       # Im guessing that Microsoft AD uses 'sAMAccountName'
    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'DC=firma,DC=local';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'OTRS_ldap_PW';

    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };

    # AuthSyncModule::LDAP::UserSyncInitialGroups
    # (sync following group with rw permission after initial create of first agent
    # login)
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
        'users',
    ];
Wenn ich nach der Fehlermeldung aus dem Systemprotokoll suche, finde ich im Netz leider nichts brauchbares.
Hat jemand vielleicht einen kleinen Tipp für mich?
Vielen Dank.

Gruß,
Andreas
Last edited by Attack44 on 27 Sep 2022, 10:06, edited 1 time in total.
root
Administrator
Posts: 3957
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: LDAP SSL - First bind failed!

Post by root »

Hi,

Code: Select all

$Self->{'AuthSyncModule::LDAP::UID'} = 'UID';
hier solltest Du stats UID den sAMAccountName eintragen.

Und bei

Code: Select all

$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'DC=firma,DC=local';
wäre dann auch besser ldapread@firma.local geeignet.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Attack44
Znuny newbie
Posts: 2
Joined: 19 Jul 2022, 15:43
Znuny Version: 6.3.4
Real Name: Andreas

Re: LDAP SSL - First bind failed!

Post by Attack44 »

root wrote: 26 Sep 2022, 17:53 Hi,

Code: Select all

$Self->{'AuthSyncModule::LDAP::UID'} = 'UID';
hier solltest Du stats UID den sAMAccountName eintragen.

Und bei

Code: Select all

$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'DC=firma,DC=local';
wäre dann auch besser ldapread@firma.local geeignet.

- Roy
Kaum macht man es richtig, funktioniert es. Da ist mir beim Copy & Paste nicht aufgefallen. Vielen Dank.

Gruß,
Andreas
Post Reply