LDAP, falscher Zeichensatz, Umlaute kaputt

Hilfe zu OTRS Problemen aller Art
Post Reply
GustavG
Znuny expert
Posts: 285
Joined: 26 Nov 2014, 15:56
Znuny Version: Znuny 6.3.4
Real Name: Gerlach

LDAP, falscher Zeichensatz, Umlaute kaputt

Post by GustavG »

Hallo,

ich habe OTRS mit LDAP Auth sowohl für Agenten als auch für Customer eingerichtet. Leider werden die Umlaute falsch dargestellt:

Code: Select all

CustomerUser: 45777 (uid=XXXXXGüther,ou=people,dc=firma,dc=de) authentication ok (REMOTE_ADDR: 192.168.199.120).

Code: Select all

User: 45212 (uid=BjörnXXXXXX,ou=people,dc=yados,dc=de) authentication ok (REMOTE_ADDR: 192.168.199.138).
Ich habe schon ein "SourceCharset => 'utf8'," und "DestCharset => 'utf8'," eingefügt, sowohl mit "utf8" und "utf-8", ohne Erfolg.

Hier meine komplette LDAP-Config:

Code: Select all

#################################################################################
## Agent Auth aus DB
#################################################################################

#Agenten Authentifizierung DB
   # Backend DB fuer Agenten
  $Self->{'AuthModule1'} = 'Kernel::System::Auth::DB';
  $Self->{'AuthModule1::DB::CryptType'} = 'crypt';

#################################################################################
# LDAP Agent
#################################################################################

# This is an example configuration for an LDAP auth. backend.
# (Make sure Net::LDAP is installed!)
$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = 'ldaps://SERVER.de';
$Self->{'AuthModule::LDAP::BaseDN'} = 'dc=FIRMA,dc=de';
$Self->{'AuthModule::LDAP::UID'} = 'employeeNumber';

# Check if the user is allowed to auth in a posixGroup
# (e. g. user needs to be in a group xyz to use otrs)
$Self->{'AuthModule::LDAP::GroupDN'} = 'ou=people,dc=FIRMA,dc=de';
$Self->{'AuthModule::LDAP::AccessAttr'} = 'employeeNumber';
# for ldap posixGroups objectclass (just uid)
$Self->{'AuthModule::LDAP::UserAttr'} = 'employeeNumber';
# for non ldap posixGroups objectclass (with full user dn)
# $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';

# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
$Self->{'AuthModule::LDAP::SearchUserDN'} = '';
$Self->{'AuthModule::LDAP::SearchUserPw'} = '';

# 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'} = '(memberOf=cn=otrs-FIRMA-agenten,ou=programme,ou=groups,dc=FIRMA,dc=de)';

# in case you want to add a suffix to each login name, then
# you can use this option. e. g. user just want to use user but
# in your ldap directory exists user@domain.
#    $Self->{'AuthModule::LDAP::UserSuffix'} = '@domain.com';

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

#################################################################################
## LDAP Sync
#################################################################################

# defines AuthSyncBackend (AuthSyncModule) for AuthModule
# if this key exists and is empty, there won't be a sync.
# example values: AuthSyncBackend, AuthSyncBackend2
$Self->{'AuthModule::UseSyncBackend'} = 'AuthSyncBackend';

# agent data sync against ldap
$Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host'} = 'ldaps://FIRMA.de';
$Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=FIRMA,dc=de';
$Self->{'AuthSyncModule::LDAP::UID'} = 'employeeNumber';
$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'anonymous';
$Self->{'AuthSyncModule::LDAP::SearchUserPw'} = '';
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
    # DB -> LDAP
    UserFirstname => 'givenName',
    UserLastname  => 'sn',
    UserEmail     => 'mail',
};

#################################################################################
## DB Customer
#################################################################################

# 1. Customer user backend: DB
# (customer database backend and settings)
$Self->{CustomerUser1} = {
    Name => 'Customer Database DB',
    Module => 'Kernel::System::CustomerUser::DB',
    Params => {
        # if you want to use an external database, add the
        # required settings
#        DSN => 'DBI:odbc:yourdsn',
#        Type => 'mssql', # only for ODBC connections
#        DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#        User => '',
#        Password => '',
        Table => 'customer_user',
    },
    # customer unique id
    CustomerKey => 'login',
    # customer #
    CustomerID => 'customer_id',
    CustomerValid => 'valid_id',
    CustomerUserListFields => ['first_name', 'last_name', 'email'],
    CustomerUserSearchFields => ['login', 'last_name', 'customer_id'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 250,
    CustomerUserPostMasterSearchFields => ['email'],
    CustomerUserNameFields => ['title','first_name','last_name'],
    CustomerUserEmailUniqCheck => 1,
#    # show not own tickets in customer panel, CompanyTickets
#    CustomerUserExcludePrimaryCustomerID => 0,
#    # generate auto logins
#    AutoLoginCreation => 0,
#    AutoLoginCreationPrefix => 'auto',
#    # admin can change customer preferences
#    AdminSetPreferences => 1,
#    # cache time to live in sec. - cache any database queries
#    CacheTTL => 0,
#    # just a read only source
#    ReadOnly => 1,
    Map => [

        # note: Login, Email and CustomerID needed!
        # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
        [ 'UserTitle',      'Title',      'title',        1, 0, 'var', '', 0 ],
        [ 'UserFirstname',  'Firstname',  'first_name',   1, 1, 'var', '', 0 ],
        [ 'UserLastname',   'Lastname',   'last_name',    1, 1, 'var', '', 0 ],
        [ 'UserLogin',      'Username',   'login',        1, 1, 'var', '', 0 ],
        [ 'UserPassword',   'Password',   'pw',           0, 0, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'email',        1, 1, 'var', '', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'customer_id',  0, 1, 'var', '', 0 ],
        [ 'UserPhone',      'Phone',      'phone',        1, 0, 'var', '', 0 ],
        [ 'UserFax',        'Fax',        'fax',          1, 0, 'var', '', 0 ],
        [ 'UserMobile',     'Mobile',     'mobile',       1, 0, 'var', '', 0 ],
        [ 'UserStreet',     'Street',     'street',       1, 0, 'var', '', 0 ],
        [ 'UserZip',        'Zip',        'zip',          1, 0, 'var', '', 0 ],
        [ 'UserCity',       'City',       'city',         1, 0, 'var', '', 0 ],
        [ 'UserCountry',    'Country',    'country',      1, 0, 'var', '', 0 ],
        [ 'UserComment',    'Comment',    'comments',     1, 0, 'var', '', 0 ],
        [ 'ValidID',        'Valid',      'valid_id',     0, 1, 'int', '', 0 ],
    ],
    # default selections
    Selections => {
        UserTitle => {
            'Mr.' => 'Herr',
            'Mrs.' => 'Frau',
        },
    },
};

#################################################################################
## LDAP Customer
#################################################################################


#Enable LDAP authentication for Customers / Users
  $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
  $Self->{'Customer::AuthModule::LDAP::Host'} = 'ldaps://FIRMA.de';
  $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'ou=people,dc=FIRMA,dc=de';
  $Self->{'Customer::AuthModule::LDAP::UID'} = 'employeeNumber';

#The following is valid but would only be necessary if the
#anonymous user do NOT have permission to read from the LDAP tree
  $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'anonymous';
  $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = '';

#CustomerUser
#(customer user database backend and settings)
    $Self->{CustomerUser} = {
      Name => 'LDAP Data Source',
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
      Host => 'ldaps://FIRMA.de',
      BaseDN => 'ou=people,dc=FIRMA,dc=de',
      SSCOPE => 'sub',
      UserDN =>'anonymous',
      UserPw => '',
      SourceCharset => 'utf8',
      AlwaysFilter => '(memberOf=cn=otrs-FIRMA-customer,ou=programme,ou=groups,dc=FIRMA,dc=de)',
    },
# customer unique id
    CustomerKey => 'employeeNumber',
    # customer #
    CustomerID => 'mail',
    CustomerUserListFields => ['uid', 'cn', 'mail'],
    CustomerUserSearchFields => ['employeeNumber', 'cn', 'mail'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 250,
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['givenname', 'sn'],
    Map => [
      # note: Login, Email and CustomerID needed!
      # var, frontend, storage, shown, required, storage-type
      [ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
      [ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
      [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
      [ 'UserLogin', 'Login', 'employeeNumber', 1, 1, 'var' ],
      [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
      [ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var' ],
      [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
      #[ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
      #[ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
    ],
  };
Jemand eine Idee?
wurzel
Znuny guru
Posts: 3232
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: LDAP, falscher Zeichensatz, Umlaute kaputt

Post by wurzel »

Hi,

mal mit nem ISO code probiert?

Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
GustavG
Znuny expert
Posts: 285
Joined: 26 Nov 2014, 15:56
Znuny Version: Znuny 6.3.4
Real Name: Gerlach

Re: LDAP, falscher Zeichensatz, Umlaute kaputt

Post by GustavG »

Danke für den Gedanken. Gerade eben getestet:

Code: Select all

$Self->{'AuthModule::LDAP::Params'} = {
    port => 636,
    timeout => 120,
    async => 0,
    version => 3,
    SourceCharset => 'iso-8859-1',
    DestCharset => 'iso-8859-1',
};
Hat nichts genützt, gleiches Problem.
nd0
Znuny expert
Posts: 232
Joined: 24 Mar 2015, 16:53
Znuny Version: 5.0.14
Location: Colonia

Re: LDAP, falscher Zeichensatz, Umlaute kaputt

Post by nd0 »

Also bei Agenten war bei uns keine Anpassung notwendig...
/e: Grad zur Sicherheit nochmal überprüft - gibt auch nirgends Probleme mit Sonderzeichen bei unserem Agenten mit Umlaut in seinem Namen :lol:

Für unsere Kunden sieht der (Ausschnitt des) Quellcode(s) folgendermaßen aus:

Code: Select all

$Self->{CustomerUser1} = {
      Name => 'LDAP - XXX',
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
        Host => 'XXX',
        BaseDN => 'XXX',
        SSCOPE => 'sub',
        UserDN =>'XXX',
        UserPw => '***',
        SourceCharset => 'utf-8',
        DestCharset => 'iso-8859-1',
        AlwaysFilter => '(mail=*)',
      },
Versuchs mal in der Kombination!
LIVE: OTRS 5.0.14 || Debian || MySQL/LDAP
TEST: OTRS 5.0.14 || Debian || MySQL/LDAP
GustavG
Znuny expert
Posts: 285
Joined: 26 Nov 2014, 15:56
Znuny Version: Znuny 6.3.4
Real Name: Gerlach

Re: LDAP, falscher Zeichensatz, Umlaute kaputt

Post by GustavG »

Wars leider auch nicht:
#(customer user database backend and settings)
$Self->{CustomerUser} = {
Name => 'LDAP Data Source',
Module => 'Kernel::System::CustomerUser::LDAP',
Params => {
Host => 'ldaps://FIRMA.de',
BaseDN => 'ou=people,dc=FIRMA,dc=de',
SSCOPE => 'sub',
UserDN =>'anonymous',
UserPw => '',
#SourceCharset => 'utf8',
SourceCharset => 'utf-8',
DestCharset => 'iso-8859-1',
AlwaysFilter => '(memberOf=cn=otrs-FIRMA-customer,ou=programme,ou=groups,dc=FIRMA,dc=de)',
},
Naja, es ist kein großer Beinbruch, werde es wohl so akzeptieren müssen..
nd0
Znuny expert
Posts: 232
Joined: 24 Mar 2015, 16:53
Znuny Version: 5.0.14
Location: Colonia

Re: LDAP, falscher Zeichensatz, Umlaute kaputt

Post by nd0 »

Werden die Umlaute denn auch im Frontend nicht korrekt angezeigt? Wie sehen die Umlaute z.B. in der "Agenten-Verwaltung" aus?

/e: Im Systemprotokoll werden die Umlaute bei uns ebenfalls nicht korrekt dargestellt.
LIVE: OTRS 5.0.14 || Debian || MySQL/LDAP
TEST: OTRS 5.0.14 || Debian || MySQL/LDAP
GustavG
Znuny expert
Posts: 285
Joined: 26 Nov 2014, 15:56
Znuny Version: Znuny 6.3.4
Real Name: Gerlach

Re: LDAP, falscher Zeichensatz, Umlaute kaputt

Post by GustavG »

Sonst werden sie überall korrekt dargestellt. Wenn sie bei dir im Systemlog ebenfalls falsch dargestellt werden, könnte es ein Bug sein?
Post Reply