Hi,

OTRS is an amazing tool and need a good administrator. :-)

I would like some help with LDAP integration.
The documentation was not enough for me. :-(

I am testing OTRS and LDAP:

1. Agent integration at dc=xx,dc=yyy,dc=yyy,dc=bb
     * Apparently ok
2. Customer base at dc=clientes
    1. It is not working. I can not see a customer
    2. Old customers are gone
3. *error.log from Apache  and otrs.log ask for Customerkey.*
     * *It is in Config.pm. I do not understand this situation
       *
4. There are not access to dc=clientes in ldap.log.
     * OTRS is asking nothing to LDAP.

I am asking for help after some days without success.
Is there some test helpful for this problem?
Do you understand item 3?

TIA

*LDAP customer data*

[root@machine Kernel]# ldapsearch -x -b "dc=clientes" 'uid=234.000061.00'

# extended LDIF
#
# LDAPv3
# base <dc=clientes> with scope subtree
# filter: uid=234.000061.00
# requesting: ALL
#
# 234.000061.00, clientes
dn: uid=234.000061.00,dc=clientes
brPersonCPF: xxxxxxxxxxx
schacDateOfBirth: 30201956
eduPersonPrimaryAffiliation: JOHN DOE FATHER
street: AV XXXXX XXXXXXX 120
l: XXXXX
postalCode: XXXXXXXX
uid: 234.000061.00
objectClass: inetOrgPerson
objectClass: brPerson
objectClass: schacPersonalCharacteristics
objectClass: eduPerson
mail: XXXXXX@XXXXX
initials: DOE
sn: SON
cn: JOHN
# search result
search: 2
result: 0 Success
# numResponses: 2
# numEntries: 1

*Apache error.log*

ERROR: OTRS-CGI-55 Perl: 5.16.3 OS: linux Time: Mon Feb  2 02:33:42 2015
* Message: Need CustomerUser->CustomerKey in Kernel/Config.pm*
 RemoteAddress: 98.235.88.38
 RequestURI: /otrs/index.pl?Action=AdminCustomerUser;Nav=Agent
 Traceback (12941):
   Module: Kernel::System::CustomerUser::LDAP::new Line: 110
   Module: Kernel::System::CustomerUser::new Line: 80
   Module: Kernel::Modules::AdminCustomerUser::new Line: 39
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 970
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 41
   Module: (eval) (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
   Module: ModPerl::Registry::handler (v1.99) Line: 32

*OTRS.LOG*
[Mon Feb 2 04:00:56 2015][Error][Kernel::System::CustomerUser::LDAP::new][110] *Need CustomerUser->CustomerKe**y in Kernel/Config.pm*

*Config.pm**:*

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2014 OTRS AG, http://otrs.com/
# --
# 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:
#
#  -->> Most OTRS configuration should be done via the OTRS web interface
#       and the SysConfig. Only for some configuration, such as database
#       credentials and customer data source changes, you should edit this
#       file. For changes do customer data sources you can copy the definitions
#       from Kernel/Config/Defaults.pm and paste them in this file.
#       Config.pm will not be overwritten when updating OTRS.
# --

package Kernel::Config;

#use strict;
use warnings;
use utf8;

sub Load {
    my $Self = shift;

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #

    # The database host
    $Self->{'DatabaseHost'} = '127.0.0.1';

    # The database name
    $Self->{'Database'} = "otrs";

    # The database user
    $Self->{'DatabaseUser'} = "otrs";

    # The password of database user. You also can use bin/otrs.CryptPassword.pl
    # for crypted passwords
    $Self->{'DatabasePw'} = '********';

    # The database DSN for MySQL ==> more: "perldoc DBD::mysql"
    $Self->{'DatabaseDSN'} = 
"DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost}";

    # The database DSN for PostgreSQL ==> more: "perldoc DBD::Pg"
    # if you want to use a local socket connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
    # if you want to use a TCP/IP connection
#    $Self->{DatabaseDSN} = 
"DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";

    # The database DSN for Microsoft SQL Server - only supported if OTRS is
    # installed on Windows as well
#    $Self->{DatabaseDSN} = "DBI:ODBC:driver={SQL 
Server};Database=$Self->{Database};Server=$Self->{DatabaseHost},1433";

    # The database DSN for Oracle ==> more: "perldoc DBD::oracle"
#    $Self->{DatabaseDSN} = 
"DBI:Oracle://$Self->{DatabaseHost}:1521/$Self->{Database}";
#
#    $ENV{ORACLE_HOME}     = '/path/to/your/oracle';
#    $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
#    $ENV{NLS_LANG}        = 'AMERICAN_AMERICA.AL32UTF8';

    # ---------------------------------------------------- #
    # 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;

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

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

    $Self->{LogModule}          = 'Kernel::System::Log::File';
    $Self->{LogModule::LogFile} = '/var/log/otrs.log';

    $Self->{Organization} = '*********';
    $Self->{ProductName} = '***********';


    $Self->{DefaultLanguage} = 'pt_BR';

    $Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host1'} = '127.0.0.1';
    $Self->{'AuthModule::LDAP::BaseDN1'} = 'dc=aa,dc=bbbbb,dc=ccc,dc=dd';
    $Self->{'AuthModule::LDAP::UID1'} = 'uid';

    $Self->{'AuthModule::LDAP::GroupDN'} = 
'cn=atendentes,ou=Group,dc=aa,dc=bbbbb,dc=ccc,dc=dd';
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'memberUid';


#    $Self->{'AuthModule::UseSyncBackend'} = 'AuthSyncBackend';

    $Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = '127.0.0.1';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=aa,dc=bbbbb,dc=ccc,dc=dd';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'uid';

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

    # Attributes needed for group syncs
    # (attribute name for group value key)
    $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'memberUid';
    # (attribute for type of group content UID/DN for full ldap name)
    $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',
    ];
    # AuthSyncModule::LDAP::UserSyncGroupsDefinition
    # (If "LDAP" was selected for AuthModule and you want to sync LDAP
    # groups to otrs groups, define the following.)
    $Self->{'AuthSyncModule::LDAP::UserSyncGroupsDefinition'} = {
#        # ldap group
        'cn=NetAdmins,ou=Group,dc=aa,dc=bbbbb,dc=ccc,dc=dd' => {
#            # otrs group
            'admin' => {
#                # permission
                rw => 1,
                ro => 1,
            },
        },
        'cn=users,ou=Group,dc=aa,dc=bbbbb,dc=ccc,dc=dd' => {
            'users' => {
                rw => 1,
                ro => 1,
            },
        }
    };

# CustomerUser
# (customer user ldap backend and settings)
    $Self->{CustomerUser} = {
        Name => 'LDAP Backend',
        Module => 'Kernel::System::CustomerUser::LDAP',
        Params => {
            Host => '127.0.0.1',
            BaseDN => 'dc=clientes',
            SSCOPE => 'sub',

            },
        },

        # customer unique id
*         CustomerKey => 'uid',*
        # customer #
        CustomerID => 'mail',
        CustomerUserListFields => ['cn', 'mail'],
        CustomerUserSearchFields => ['uid', 'cn', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit => 250,
        CustomerUserPostMasterSearchFields => ['mail'],
        CustomerUserNameFields => ['givenname', 'initials', 'sn'],
#        # show now own tickets in customer panel, CompanyTickets
        CustomerUserExcludePrimaryCustomerID => 0,
#        # add a ldap filter for valid users (expert setting)
#        # CustomerUserValidFilter => '(!(description=gesperrt))',
#        # admin can't change customer preferences
        AdminSetPreferences => 0,
#        # cache time to live in sec. - cache any ldap queries
#        CacheTTL => 0,
        Map => [
#            # note: Login, Email and CustomerID needed!
#            # 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 ],
#            # [ 'UserCustomerIDs', 'CustomerIDs', 'second_customer_ids', 1, 0, 
'var', '', 0 ],
            [ 'UserPhone',      'Phone',      'telephonenumber', 1, 0, 'var', 
'', 0 ],
            [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', 
'', 0 ],
            [ 'UserComment',    'Comment',    'description',     1, 0, 'var', 
'', 0 ],
        ],

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

# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #

use base qw(Kernel::Config::Defaults);

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

1;


--
Cosme Corrêa
Canal SAC
+55 21 4042-6606

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Reply via email to