OTRS LDAP auth und auto Rollen Zuweisung.

Hilfe zu Znuny Problemen aller Art
Locked
ABrandt
Znuny newbie
Posts: 6
Joined: 23 May 2013, 16:10
Znuny Version: 3.1.7
Real Name: Arne Brandt

OTRS LDAP auth und auto Rollen Zuweisung.

Post by ABrandt »

Hallo,

ich bin gerade dabei ein neues OTRS bei uns aufzusetzen und stehe vor der Schwierigkeit gegen bestimmte AD::LDAP Gruppen zu Authentifizieren.
Die LDAP Anbindung als solches funktioniert und tut was Sie soll, nur bekomme ich die Einschränkung auf bestimmte Gruppen nicht hin.
Desweiteren soll dieser AD Gruppe dann automatisch eine Rolle zugewiesen bekommen.

Jetzt zu meinem Problem:

Die User auth gegen AD funktioniert. Problem ist hier aber, dass jeder AD Login Funktioniert und nicht nach der Gruppe gefiltert wird.
Das nächste Problem ist, dass der User dann auch nicht der Rolle zugewiesen wird.
Einzige Fehlermeldung die ich in der error.log sehe:

Code: Select all

[Thu May 23 15:33:48 2013] -e: Argument "" isn't numeric in numeric eq (==) at /usr/share/otrs//Kernel/Modules/AdminRoleGroup.pm line 174.
Config.pm

Code: Select all


################### AD Integration Code START########################

## LDAP Group 1 #########

        $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
        $Self->{'AuthModule::LDAP::Host'} = 'deldaphostxxxx';
        $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=xxx1,DC=xxx2,DC=xxx3';
        $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
        $Self->{'AuthModule::LDAP::SearchUserDN'} = 'otrsauth.1@xxx1.xxx2.xxx3';
        $Self->{'AuthModule::LDAP::SearchUserPw'} = 'xxxxxx';
        $Self->{'AuthModule::LDAP::Params'} = {
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
        };
        $Self->{'AuthModule::LDAP::AccessAttr'} = 'CN=DE-Gruppe-1';

## LDAP Group 2 #########

        $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
        $Self->{'AuthModule::LDAP::Host'} = 'deldaphostxxxx';
        $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=xxx1,DC=xxx2,DC=xxx3';
        $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
        $Self->{'AuthModule::LDAP::SearchUserDN'} = 'otrsauth.1@xxx1.xxx2.xxx3';
        $Self->{'AuthModule::LDAP::SearchUserPw'} = 'xxxxxx';
        $Self->{'AuthModule::LDAP::Params'} = {
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
        };
        $Self->{'AuthModule::LDAP::AccessAttr'} = 'CN=DE-Gruppe-2';

# Sync data with OTRS DB
        $Self->{'UserSyncLDAPMap'};
        $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
        $Self->{'AuthSyncModule::LDAP::Host'} = 'deldaphostxxxx';
        $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'DC=xxx1,DC=xxx2,DC=xxx3';
        $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
        $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'otrsauth.1@xxx1.xxx2.xxx3';
        $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'xxxxxx';
        $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {

                # DB -> LDAP
                UserFirstname => 'givenName',
                UserLastname  => 'sn',
                UserEmail     => 'mail',
#               UserMobileNumber  => 'telephoneNumber', #(Optional)
        };

#    # AuthSyncModule::LDAP::UserSyncInitialGroups
#    # (sync following group with rw permission after initial create of first agent login)

        $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [ 'users', ];
        $Self->{'AuthSyncModule::LDAP::UserSyncRolesDefinition'} = {
                # ldap group
               'cn=DE-Gruppe-1' => {
                        # otrs role
                       'DE-Gruppe-1' => 1,
               },
               'cn=DE-Gruppe-2' => {
                       'DE-Gruppe-2' => 1,
               },
               'cn=DE-Gruppe-3' => {
                       'DE-Gruppe-3' => 1,
               },
                'CN=DE-Gruppe-4' => {
                        'DE-Gruppe-4' => 1,
                },


        };


################### AD Integration Code END ########################


Das ganze läuft auf einem aktuellen Debian (Linux version 3.2.0-4-amd64) mit Apache2.
Vllt. habe ich bei der ganzen Geschichte ja auch ein grundsätzliches Verständnisproblem und hoffe ihr könnt helfen.

Vielen Dank im Voraus

Arne

Edit (24.05,10:44Uhr): Hat einer der Mod's o.ä. ein Problem, wenn ich diese Anfrage, sollte mir bis heute Abend niemand helfen können, in einem anderem Forum poste? Mfg Arne
ABrandt
Znuny newbie
Posts: 6
Joined: 23 May 2013, 16:10
Znuny Version: 3.1.7
Real Name: Arne Brandt

Re: OTRS LDAP auth und auto Rollen Zuweisung.

Post by ABrandt »

Hallo,

da scheinbar niemand helfen kann, möchte ich fragen ob jmd. eine gute Support-Quelle kennt?


Mfg Arne
Hazet
Znuny wizard
Posts: 383
Joined: 19 Feb 2009, 12:05
Znuny Version: 5.0.9
Real Name: Harald Zahn
Company: Klinikum Augsburg
Location: Augsburg

Re: OTRS LDAP auth und auto Rollen Zuweisung.

Post by Hazet »

Produktiv: OTRS 5.0.9 , (ITSM 5.0.10) unter Ubuntu 14.04, mysql 5.5
Test: OTRS 5.0.8 , (ITSM 5.0.8), KIX unter Ubuntu 14.04, mysql 5.5
ABrandt
Znuny newbie
Posts: 6
Joined: 23 May 2013, 16:10
Znuny Version: 3.1.7
Real Name: Arne Brandt

Re: OTRS LDAP auth und auto Rollen Zuweisung.

Post by ABrandt »

Vielen Dank, nur hilft mir das nicht richtig weiter, da AD Auth als solches ja funktioniert.
Ich möchte jetzt einfach nur das mehrere AD Gruppen darauf Zugreifen dürfen und nicht nur eine einzige.
Es befinden sich die Gruppen auch auf einer AD.

Es funktioniert jeweils nur wenn ein Member der ersten Gruppe sich authentifizieren möchte.

Code: Select all


        $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
        $Self->{'AuthModule::LDAP::Host'} = 'dexxxx.dc1.dc2.dc3';
        $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=dc1,DC=dc2,DC=dc3';
        $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=DEGROUP1,OU=Organizational,OU=Groups,OU=DE,DC=dc1,DC=dc2,DC=dc3';
        $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
        $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
        $Self->{'AuthModule::LDAP::SearchUserDN'} = 'otrsuser@dc1.dc2.dc3';
        $Self->{'AuthModule::LDAP::SearchUserPw'} = 'password';
        $Self->{'AuthModule::LDAP::Params'} = {
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
        };

        $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
        $Self->{'AuthModule::LDAP::Host1'} = 'dexxxx.dc1.dc2.dc3';
        $Self->{'AuthModule::LDAP::BaseDN1'} = 'DC=dc1,DC=dc2,DC=dc3';
        $Self->{'AuthModule::LDAP::GroupDN1'} = 'CN=DEGROUP2,OU=Organizational,OU=Groups,OU=DE,DC=dc1,DC=dc2,DC=dc3';
        $Self->{'AuthModule::LDAP::AccessAttr1'} = 'member';
        $Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';
        $Self->{'AuthModule::LDAP::SearchUserDN'} = 'otrsuser@dc1.dc2.dc3';
        $Self->{'AuthModule::LDAP::SearchUserPw'} = 'password';
        $Self->{'AuthModule::LDAP::Params'} = {
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
        };

Danke für die Unterstützung.
KlausNehrer
Znuny ninja
Posts: 1312
Joined: 25 May 2012, 08:51
Znuny Version: OTRS 4
Real Name: Klaus Nehrer

Re: OTRS LDAP auth und auto Rollen Zuweisung.

Post by KlausNehrer »

Noch nicht getestet - Und wenn Du die Gruppen in einen Gruppe übernimmst? Alternativ vielleicht dynamische Gruppen?
ABrandt
Znuny newbie
Posts: 6
Joined: 23 May 2013, 16:10
Znuny Version: 3.1.7
Real Name: Arne Brandt

Re: OTRS LDAP auth und auto Rollen Zuweisung.

Post by ABrandt »

Ich hab es.... au man... er kam nicht damit klar, dass bei beiden Blöcken

Code: Select all

$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
stand.
Beim nächsten musste

Code: Select all

$Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';
stehen damit es funktioniert.

Code: Select all


#LDAP DEGroup1

        $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
        $Self->{'AuthModule::LDAP::Host'} = 'dexxx.dc1.dc2.dc3;
        $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=dc1,DC=dc2,DC=ads';
        $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=DEGROUP1,OU=Organizational,OU=Groups,OU=DE,DC=emea,DC=tpg,DC=ads';
        $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
        $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
        $Self->{'AuthModule::LDAP::SearchUserDN'} = 'user';
        $Self->{'AuthModule::LDAP::SearchUserPw'} = 'pw';
        $Self->{'AuthModule::LDAP::Params'} = {
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
        };

#LDAP DEGroup2

        $Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';
        $Self->{'AuthModule::LDAP::Host1'} = 'dexxx.dc1.dc2.dc3;
        $Self->{'AuthModule::LDAP::BaseDN1'} = 'DC=dc1,DC=dc2,DC=ads';
        $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=DEGROUP2,OU=Organizational,OU=Groups,OU=DE,DC=emea,DC=tpg,DC=ads';
        $Self->{'AuthModule::LDAP::AccessAttr1'} = 'member';
        $Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';
        $Self->{'AuthModule::LDAP::SearchUserDN1'} = user;
        $Self->{'AuthModule::LDAP::SearchUserPw1'} = 'pw';
        $Self->{'AuthModule::LDAP::Params'} = {
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
        };


Jetzt habe ich noch das Problem dass der Agent keine Rolle zugewiesen bekommt.
Wenn ich diesem Agent manuell eine Rolle zuweise verschwindet die zuweisung sobald sich der User anmeldet,
also scheint er ja was zu machen, nur nicht das richtige. Kann da mal jmd. drauf gucken, evtl. hab ich ja einen Typo.

Code: Select all

$Self->{'AuthSyncModule::LDAP::UserSyncRolesDefinition'} = {
                #LDAP Group
                'CN=DEGROUP1,OU=Organizational,OU=Groups,OU=DE,DC=emea,DC=tpg,DC=ads' => {
                        #OTRS Role
                        'DEGROUP1 ROLE' => '1',
                },
                'CN=DEGROUP2,OU=Organizational,OU=Groups,OU=DE,DC=emea,DC=tpg,DC=ads' => {
                         'DEGROUP2 ROLE' => '1',
                },
                'CN=DEGROUP3,OU=Organizational,OU=Groups,OU=DE,DC=emea,DC=tpg,DC=ads' => {
                         'DEGROUP3 ROLE' => '1',
                },
               
        };
Locked