Ldap Integration missing customers

Moderator: crythias

Locked
lkelly
Znuny newbie
Posts: 5
Joined: 24 Oct 2012, 17:20
Znuny Version: 3.1.11
Real Name: Liam Kelly
Company: Numark International

Ldap Integration missing customers

Post by lkelly »

I have OTRS 3.1.11 integrated with my 2008 R2 Domain and I show only 21 of my 400+ users in my customer list.
2 days and it's driving me mad. Please let me know what I have done wrong

Below is my Config.pm

Code: Select all

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2011 xxx, http://otrs.org/
# --
# $Id: Config.pm.dist,v 1.25 2011/09/16 10:58:28 mg Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
#  Note:
#
#  -->> OTRS does have a lot of config settings. For more settings
#       (Notifications, Ticket::ViewAccelerator, Ticket::NumberGenerator,
#       LDAP, PostMaster, Session, Preferences, ...) see
#       Kernel/Config/Defaults.pm and copy your wanted lines into "this"
#       config file. This file will not be changed on update!
#
# --

package Kernel::Config;

use utf8;

sub Load {
    my $Self = shift;
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #         Start of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #
    # DatabaseHost
    # (The database host.)
    $Self->{'DatabaseHost'} = 'localhost';
    # Database
    # (The database name.)
    $Self->{'Database'} = 'otrs';
    # DatabaseUser
    # (The database user.)
    $Self->{'DatabaseUser'} = 'otrs';
    # DatabasePw
    # (The password of database user. You also can use bin/otrs.CryptPassword.pl
    # for crypted passwords.)
    $Self->{'DatabasePw'} = 'hot';
    # DatabaseDSN
    # (The database DSN for MySQL ==> more: "man DBD::mysql")
    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

    # (The database DSN for PostgreSQL ==> more: "man DBD::Pg")
    # if you want to use a local socket connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
    # if you want to use a tcpip connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";
    # if you have PostgresSQL 8.1 or earlier, activate the legacy driver with this line:
#    $Self->{DatabasePostgresqlBefore82} = 1;

    # ---------------------------------------------------- #
    # fs root directory
    # ---------------------------------------------------- #
    $Self->{Home} = '/opt/otrs';

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;
     # Enable LDAP lookups for Customer logins.
#    $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
#    $Self->{'Customer::AuthModule::LDAP::Host'} = '10.10.0.28';
#    $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=corp,dc=numark,dc=com';
#    $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
#    $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'cn=otrs,cn=Users,dc=corp,dc=numark,dc=com';
#    $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = '*******';
#    $Self->{'Customer::AuthModule::LDAP::AlwaysFilter'} = '(objectclass=user)';
#    $Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'cn=otrscust,ou=Services,ou=Administrative,ou=Groups,dc=corp,dc=numark,dc=com';
#    $Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'cn=OTRS Customers,cn=Users,dc=mydomain,dc=local';
#    $Self->{'Customer::AuthModule::LDAP::AccessAttr'} = 'memberUid';
#    $Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'UID';

    # Enable LDAP lookups for Customer account information.
    $Self->{CustomerUser} = {
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
        Host => '10.10.0.28',
        BaseDN => 'dc=corp,dc=numark,dc=com',
        SSCOPE => 'sub',
        UserDN => 'cn=otrs,cn=Users,dc=corp,dc=numark,dc=com',
        UserPw => '*******',
 #       AlwaysFilter => '(&(objectClass=user)(!(objectClass=Computer))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))',
#        GroupDN => 'cn=otrscust,ou=Services,ou=Administrative,ou=Groups,dc=corp,dc=numark,dc=com',
#        GroupDN => 'cn=OTRS Customers,cn=Users,dc=mydomain,dc=local',
#       AccessAttr => 'memberUid',
#        UserAttr => 'UID',
      },
      CustomerKey => 'sAMAccountName',
      CustomerID => 'mail',
      CustomerUserListFields => ['sAMAccountName', 'cn', 'sn', 'givenname', 'company',  'mail'],
      CustomerUserSearchFields => ['sAMAccountName', 'cn', 'sn', 'givenname', 'company', 'mail'],
      CustomerUserPostMasterSearchFields => ['mail'],
      CustomerUserNameFields => ['givenname', 'sn'],
      CustomerUserValidFilter => '(company=*)',
      Map => [
        [ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
        [ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
        [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
        [ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
        [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
        [ 'UserCustomerID', 'CustomerID', 'company', 0, 1, 'var' ],
        [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
        [ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
        [ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
      ],
    };
    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #
    # $DIBI$

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #           End of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
}

# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #
use strict;
use warnings;

use vars qw(@ISA $VERSION);
$VERSION = qw($Revision: 1.25 $)[1];

use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');

# -----------------------------------------------------#

1;
OTRS 3.1.11 on CentOS 5.8
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Ldap Integration missing customers

Post by crythias »

you have all your customer from ldap commented out.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
lkelly
Znuny newbie
Posts: 5
Joined: 24 Oct 2012, 17:20
Znuny Version: 3.1.11
Real Name: Liam Kelly
Company: Numark International

Re: Ldap Integration missing customers

Post by lkelly »

I don't care about customer logins. They will be sending everything via email. All I am interested is the customer look up via ldap so I can track user history. I thought that was all here, which is not commented out.

I do have my filter commented out but I still am getting 21 users. I need to retrieve them all. I have tried filtering on an OTRS group but that gives me nothing. I would be happy just to pull all users in the AD.

Code: Select all

    # Enable LDAP lookups for Customer account information.
    $Self->{CustomerUser} = {
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
        Host => '10.10.0.28',
        BaseDN => 'dc=corp,dc=numark,dc=com',
        SSCOPE => 'sub',
        UserDN => 'cn=otrs,cn=Users,dc=corp,dc=numark,dc=com',
        UserPw => '*******',
#       AlwaysFilter => '(&(objectClass=user)(!(objectClass=Computer))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))',
#        GroupDN => 'cn=otrscust,ou=Services,ou=Administrative,ou=Groups,dc=corp,dc=numark,dc=com',
#        GroupDN => 'cn=OTRS Customers,cn=Users,dc=mydomain,dc=local',
#       AccessAttr => 'memberUid',
#        UserAttr => 'UID',
      },
      CustomerKey => 'sAMAccountName',
      CustomerID => 'mail',
      CustomerUserListFields => ['sAMAccountName', 'cn', 'sn', 'givenname', 'company',  'mail'],
      CustomerUserSearchFields => ['sAMAccountName', 'cn', 'sn', 'givenname', 'company', 'mail'],
      CustomerUserPostMasterSearchFields => ['mail'],
      CustomerUserNameFields => ['givenname', 'sn'],
      CustomerUserValidFilter => '(company=*)',
      Map => [
        [ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
        [ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
        [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
        [ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
        [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
        [ 'UserCustomerID', 'CustomerID', 'company', 0, 1, 'var' ],
        [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
        [ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
        [ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
      ],
    };
OTRS 3.1.11 on CentOS 5.8
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Ldap Integration missing customers

Post by crythias »

lkelly wrote:I don't care about customer logins.
That's where the user list originates.
lkelly wrote:I do have my filter commented out but I still am getting 21 users.
This is from your database of customer logins because the default is database, and since you have not said, "look up users in ldap", you get the list that is in the database.

CustomerUser is data that is requested once the authentication is checked.
"But I'm only handling this via email"
And yes, CustomerUser is what postmaster uses to look up customers.
"So why isn't the customer list showing this?"
Because the customer list is for authorized users.
"Why is it only 21 users?"
That's how many customers are in your database.

TL;DR: It's not relevant to you that there is a customer list in OTRS because they're all email. If it is, you'd set CustomerAuth to look up the list via LDAP (also check this drop down list on the left for the backend).
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
lkelly
Znuny newbie
Posts: 5
Joined: 24 Oct 2012, 17:20
Znuny Version: 3.1.11
Real Name: Liam Kelly
Company: Numark International

Re: Ldap Integration missing customers

Post by lkelly »

Ok I have made those changes here is my newest Config.pm (or at least the relevant parts). Still have the same number of customers listed. I have no customers in the database itself, it must be pulling these 21 from the AD.

Code: Select all

  # Enable LDAP lookups for Customer logins.
    $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
    $Self->{'Customer::AuthModule::LDAP::Host'} = '10.10.0.28';
    $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=corp,dc=numark,dc=com';
    $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'cn=otrs,cn=Users,dc=corp,dc=numark,dc=com';
    $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'numark10';
    $Self->{'Customer::AuthModule::LDAP::AlwaysFilter'} = '(objectclass=user)';
#    $Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'CN=otrscust,OU=Administrative,OU=Groups,DC=corp,DC=numark,DC=com';
#    $Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'cn=OTRS Customers,cn=Users,dc=mydomain,dc=local';
    $Self->{'Customer::AuthModule::LDAP::AccessAttr'} = 'memberUid';
    $Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'UID';

    # Enable LDAP lookups for Customer account information.
    $Self->{CustomerUser} = {
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
        Host => '10.10.0.28',
        BaseDN => 'dc=corp,dc=numark,dc=com',
        SSCOPE => 'sub',
        UserDN => 'cn=otrs,cn=Users,dc=corp,dc=numark,dc=com',
        UserPw => 'numark10',
        AlwaysFilter => '(objectClass=user)',
#      GroupDN => 'CN=otrscust,OU=Administrative,OU=Groups,DC=corp,DC=numark,DC=com',
#       GroupDN => 'cn=OTRS Customers,cn=Users,dc=mydomain,dc=local',
        AccessAttr => 'memberUid',
        UserAttr => 'UID',
      },
      CustomerKey => 'sAMAccountName',
      CustomerID => 'mail',
      CustomerUserListFields => ['sAMAccountName', 'cn', 'sn', 'givenname', 'company',  'mail'],
      CustomerUserSearchFields => ['sAMAccountName', 'cn', 'sn', 'givenname', 'company', 'mail'],
      CustomerUserPostMasterSearchFields => ['mail'],
      CustomerUserNameFields => ['givenname', 'sn'],
      CustomerUserValidFilter => '(company=*)',
      Map => [
        [ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
        [ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
        [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
        [ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
        [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
        [ 'UserCustomerID', 'CustomerID', 'company', 0, 1, 'var' ],
        [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
        [ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
        [ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
      ],
    };
OTRS 3.1.11 on CentOS 5.8
lkelly
Znuny newbie
Posts: 5
Joined: 24 Oct 2012, 17:20
Znuny Version: 3.1.11
Real Name: Liam Kelly
Company: Numark International

Re: Ldap Integration missing customers

Post by lkelly »

I got it, I commented out CustomerUserValidFilter => '(Company=*)' and I got everyone.

So I changed it to CustomerUserValidFilter => '(mail=*)' so I only get the mail capable users.
OTRS 3.1.11 on CentOS 5.8
Locked