[SOLVED] LDAP Anbindung - Kein Zusammenspiel mit SG

Hilfe zu Znuny Problemen aller Art
Locked
gustav
Znuny newbie
Posts: 29
Joined: 10 Mar 2014, 17:49
Znuny Version: 3.3.8

[SOLVED] LDAP Anbindung - Kein Zusammenspiel mit SG

Post by gustav »

Hallo Zusammen,

ich habe folgendes Problem:
Ich habe eine LDAP Anbindung über OUs hergestellt. Authentifizierung der Agenten funktioniert wunderbar. Allerdings nur über OUs.

Mit Sicherheitsgruppen scheint er nicht klar zu kommen. LDAP Pfad (CN=...) ist vollständig (siehe Ausschnitt Config.pm)

Zudem möchte ich Rollen mit Sicherheitsgruppen verknüpfen, funktioniert aber auch nicht - vielleicht liegt es nur an einem Parameter, den ich vergessen habe umzustellen...
Wie gesagt über OUs funktioniert die das Ganze nur über Sicherheitsgruppen nicht...

Fehler aus dem Systemprotokoll:
OTRS-LDAP.PNG
Ausschnitt aus der Config.pm

Code: Select all

## LDAP Agent Sync

# Net::LDAP new parameters basic settings(if needed - for more info see perldoc Net::LDAP)	
    $Self->{'AuthSyncModule::LDAP::Params'} = {
        port    => 389,
        timeout => 120,
        async   => 0,
        version => 3,
    };
	
# In case you need to use OTRS in iso-charset, you can define this by using this option (converts utf-8 data from LDAP to iso).
    $Self->{'AuthSyncModule::LDAP::Charset'} = 'iso-8859-1';

# This is an example configuration for an LDAP auth sync. backend.(take care that Net::LDAP is installed!)
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'x.x.x.x';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'CN=G_xxx,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local';
#$Self->{'AuthSyncModule::LDAP::BaseDN'} = 'OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local';
    $Self->{'AuthSyncModule::LDAP::UID'} = '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->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=otrs search,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'otrssearch';

# UserSyncLDAPGroups(If "LDAP" was selected="selected" for AuthModule, you can specify initial user groups for first login.)
    $Self->{UserSyncLDAPGroups} = [
        'users',
    ];
	
# AuthSyncModule::LDAP::UserSyncMap (map if agent should create/synced from LDAP to DB after successful login)
    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };

    # AuthSyncModule::LDAP::UserSyncRolesDefinition
    # (If "LDAP" was selected for AuthModule and you want to sync LDAP
    # groups to otrs roles, define the following.)
    $Self->{'AuthSyncModule::LDAP::UserSyncRolesDefinition'} = {
        # AD/LDAP group 
        'CN=G_xxx1,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local' => {
            # OTRS role - R_Admin
            'R_Admin' => 1,
        },
		
        # AD/LDAP group 
        'CN=G_xxx2,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local' => {
            # OTRS role - R_Abt1
            'R_Abt1' => 1,
        },
		
        # AD/LDAP group 
        'CN=G_xxx3,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local' => {
            # OTRS role - R_Abt2
            R_Abt2' => 1,
        },
		
        # AD/LDAP group 
        'CN=G_xxx4,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local' => {
            # OTRS role - R_Abt3
            'R_Abt3' => 1,
        },
		
        # AD/LDAP group 
        'CN=G_xxx5,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local' => {
            # OTRS role - R_Abt4
            'R_Abt4' => 1,
        },
		
        # AD/LDAP group 
        'CN=G_xxx6,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local' => {
            # OTRS role - R_Abt5
            'R_Abt5' => 1,
        },
	};		
		
## LDAP Agent Auth
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = 'x.x.x.x';
    $Self->{'AuthModule::LDAP::BaseDN'} = 'CN=G_xxx,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local';
#	$Self->{'AuthModule::LDAP::BaseDN'} = 'OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local';
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';

    $Self->{'AuthModule::LDAP::UserAttr'} = 'member';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'UID';

    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=otrs search,CN=G_xxx,OU=xxx1,OU=xxx2,OU=xxx3,DC=DOMÄNE,DC=local';
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'otrssearch';

    $Self->{'AuthModule::LDAP::Params'} = {
        port    => 389,
        timeout => 120,
        async   => 0,
        version => 3,
    };

You do not have the required permissions to view the files attached to this post.
Last edited by gustav on 27 Aug 2014, 15:40, edited 1 time in total.
Testsystem: OTRS 3.3.8 | ITSM 3.3.8 | KIXCore | KIX4OTRS | CentOS 6.5
gustav
Znuny newbie
Posts: 29
Joined: 10 Mar 2014, 17:49
Znuny Version: 3.3.8

Re: LDAP Anbindung - Kein Zusammenspiel mit SG

Post by gustav »

OK diese Fehlermeldung habe ich beseitig:

Code: Select all

 No UserID found for 'XYZ'! 
Lag in der Config.pm an: member welches durch memberof ersetzt werden musste.


Allerdings besteht immernoch das Problem dass ich mich nicht anmelden kann.

Code: Select all

Search failed! 0000208D: NameErr: DSID-0310020A, problem 2001 (NO_OBJECT), data 0, best match of:
Testsystem: OTRS 3.3.8 | ITSM 3.3.8 | KIXCore | KIX4OTRS | CentOS 6.5
gustav
Znuny newbie
Posts: 29
Joined: 10 Mar 2014, 17:49
Znuny Version: 3.3.8

Re: LDAP Anbindung - Kein Zusammenspiel mit SG

Post by gustav »

Problem erledigt - es lag an den falschen Einstellungen in:
$Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'member';
$Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN';

Wer den gesamten Quellcode der Config.pm für Agenten Authentifizierung und Sync mit Sicherheitsgruppen/Rollen haben möchte:

Code: Select all

## LDAP Agent Auth
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = '192.168.15.100';
    $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=XX,DC=YY';
    $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=SG_OTRS_Agent,OU=Sicherheitsgruppen,OU=Gruppen,OU=Firma,DC=XX,DC=YY';
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';

    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';
	
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=otrs search,OU=Benutzer,OU=Firma,DC=XX,DC=YY';
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'otrssearch';


## LDAP Agent Sync	
    $Self->{'AuthSyncModule::LDAP::Params'} = {
        port    => 389,
        timeout => 120,
        async   => 0,
        version => 3,
    };
	
    $Self->{'AuthSyncModule::LDAP::Charset'} = 'iso-8859-1';

    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = '192.168.15.100';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'DC=XX,DC=YY';
    $Self->{'AuthSyncModule::LDAP::GroupDN'} = 'CN=SG_OTRS_Agent,OU=Sicherheitsgruppen,OU=Gruppen,OU=Firma,DC=XX,DC=YY';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountname';

    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=otrs search,OU=Benutzer,OU=Firma,DC=XX,DC=YY';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'otrssearch';

    $Self->{UserSyncLDAPGroups} = [
        'users',
    ];
	
    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };
	
    $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'member';
    $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN';

    # 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=SG_Admin,OU=Sicherheitsgruppen,OU=Gruppen,DC=XX,DC=YY' => {
            # otrs role
            'R_Admin' => 1,
        },
        'CN=SG_Test1,OU=Sicherheitsgruppen,OU=Gruppen,OU=Firma,DC=XX,DC=YY' => {
            'R_Test1' => 1,
        },
	'CN=SG_Test2,OU=Sicherheitsgruppen,OU=Gruppen,OU=Firma,DC=XX,DC=YY' => {
            'R_Test2' => 1,
        },
        'CN=SG_Test3,OU=Sicherheitsgruppen,OU=Gruppen,OU=Firma,DC=XX,DC=YY' => {
            'R_Test3' => 1,
        },
        'CN=SG_Test4,OU=Sicherheitsgruppen,OU=Gruppen,OU=Firma,DC=XX,DC=YY' => {
            'R_Test4 => 1,
        },
        'CN=SG_Test5,OU=Sicherheitsgruppen,OU=Gruppen,OU=Firma,DC=XX,DC=YY' => {
            'R_Test5' => 1,
        }
    };
Testsystem: OTRS 3.3.8 | ITSM 3.3.8 | KIXCore | KIX4OTRS | CentOS 6.5
Locked