AD/LADP Issue "...no user data can be found in OTRS DB!!"

Moderator: crythias

Locked
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

AD/LADP Issue "...no user data can be found in OTRS DB!!"

Post by dbendon »

Version 3.1.4 - New install on Ubuntu Server with LDAP to 2008 Server

I have setup AD athentication as best I can but it doesn't see to work right so I was hoping someone could assist.

The setup is I want all users in my AD to be customers, agents I can setup manually as there are very few.

My customers list has been populated from the AD as expected but when a custoemr tries to login they get the following error.

Panic, user authenticated but no user data can be found in OTRS DB!! Perhaps the user is invalid.

The user in the customers list seems complete.

Below is the setup of my config.pm

Code: Select all

$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
   $Self->{'AuthModule::LDAP::Host'} = 'server2.smosh.local'; 
   $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
   $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
   $Self->{'AuthModule::LDAP::SearchUserDN'} = 'smosh\ldap';
   $Self->{'AuthModule::LDAP::SearchUserPw'} = '********';
  
   $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
   $Self->{'Customer::AuthModule::LDAP::Host'} = 'server2.smosh.local';
   $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
   $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
   $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'smosh\ldap';
   $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = '********';

 $Self->{CustomerUser} = {
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
      Host => 'server2.smosh.local',
      BaseDN => 'dc=smosh, dc=local',
      SSCOPE => 'sub',
      UserDN => 'smosh\ldap',
      UserPw => '********',
    },
    CustomerKey => 'sAMAccountName',
    CustomerID => 'mail',
    CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['givenname', 'sn'],
    Map => [
      [ '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', 'mail', 0, 1, 'var' ],
    ],
  };  
Perhaps of note: Initally my config.ph didn't have any of the following lines configured.

Code: Select all

$Self->{AuthModule} = 'Kernel::System::Auth::DB';
$Self->{'AuthModule::UseSyncBackend'} = '';
$Self->{'AuthModule::DB::CryptType'} = 'md5';
Although enabeling them all and setting UseSyncBackend to AuthSyncBackend2 results in a "Internal Server Error" when logging in as an agent. Commenting out just the UseSyncBackend line allows agent login but the "...no user data can be found in OTRS DB!!" still persists for customers.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by crythias »

Don't forget the CustomerAuthSync settings (search the forum or Defaults.pm and copy/paste to Config.pm)
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
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

Thanks for the reply, but I can't seem to find any entries for CustomerAuthSync settings on the forum or in the default.pm file, only entries for agent sync.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by crythias »

Sorry. I made a mistake. The authsync is for agents/Users.
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
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

OK, I added the following but the error is still the same.

Code: Select all

    $Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'server2.smosh.local';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

To clarify, below is my full config file.

I am unclear on how the following lines should be set:

Code: Select all

$Self->{AuthModule} = 'Kernel::System::Auth::DB';
$Self->{'AuthModule::UseSyncBackend'} = '??????????';
$Self->{'AuthModule::DB::CryptType'} = 'md5';
If $Self->{'AuthModule::UseSyncBackend'} = '??????????'; is uncommented and set to either AuthSyncBackend2 of AuthSyncBackend I get Internal Server Error when logging in as an agent, but regardless still get the same error when a customer logs in.

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'} = '********';
    # 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;

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

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

    # This is the auth. module againt the otrs db
    $Self->{AuthModule} = 'Kernel::System::Auth::DB';
#    $Self->{'AuthModule::UseSyncBackend'} = 'AuthSyncBackend';
    $Self->{'AuthModule::DB::CryptType'} = 'md5';

    # This is the auth. module againt the otrs LDAP

   $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
   $Self->{'AuthModule::LDAP::Host'} = 'server2.smosh.local'; 
   $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
   $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
   $Self->{'AuthModule::LDAP::SearchUserDN'} = 'smosh\ldap';
   $Self->{'AuthModule::LDAP::SearchUserPw'} = '********';
  
   $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
   $Self->{'Customer::AuthModule::LDAP::Host'} = 'server2.smosh.local';
   $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
   $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
   $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'smosh\ldap';
   $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = '********';

 $Self->{CustomerUser} = {
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
      Host => 'server2.smosh.local',
      BaseDN => 'dc=smosh, dc=local',
      SSCOPE => 'sub',
      UserDN => 'smosh\ldap',
      UserPw => '********',
    },
    CustomerKey => 'sAMAccountName',
    CustomerID => 'mail',
    CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['givenname', 'sn'],
    Map => [
      # note: Login, Email and CustomerID needed!
      # var, frontend, storage, shown, required, storage-type
      [ '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', 'mail', 0, 1, 'var' ],

    ],
  };   
   
    $Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'server2.smosh.local';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #           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;
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by crythias »

Customers authenticate against customer.pl, agents in index.pl

Code: Select all

$Self->{AuthModule} = 'Kernel::System::Auth::DB';
$Self->{'AuthModule::UseSyncBackend'} = '??????????';
$Self->{'AuthModule::DB::CryptType'} = 'md5';
AuthModule is already defined as LDAP, so it doesn't need to be redefined as DB
http://doc.otrs.org/3.1/en/html/auth-backends.html

No User Data is related to no matching backend for customer data. (Read: Authentication succeeds, but there's no match for the data).

The only significant thing I see here is that you don't have a Name => entry in CustomerUser.
http://doc.otrs.org/3.1/en/html/custome ... ckend-ldap

Also, you're using sAMAccountname vs uid for customer matching key I don't know if that is significant.
Check http://wiki.otterhub.org/index.php?titl ... _customers for another example.
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
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

Thanks again for the reply but still no luck.

Made a few minor changes as per your notes and changed to other examples but it's still the same.

Current 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'} = '********';
    # 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;

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

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

    # This is the auth. module againt the otrs LDAP

   $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
   $Self->{'AuthModule::LDAP::Host'} = 'server2.smosh.local'; 
   $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
   $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
   $Self->{'AuthModule::LDAP::SearchUserDN'} = 'smosh\ldap';
   $Self->{'AuthModule::LDAP::SearchUserPw'} = '********';
  
   $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
   $Self->{'Customer::AuthModule::LDAP::Host'} = 'server2.smosh.local';
   $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
   $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
   $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'smosh\ldap';
   $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = '********';

 $Self->{CustomerUser} = {
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
	  Name => 'LDAP Data Source',
      Host => 'server2.smosh.local',
      BaseDN => 'dc=smosh, dc=local',
      SSCOPE => 'sub',
      UserDN => 'smosh\ldap',
      UserPw => '********',
      Params => {
      port => 3268,
      timeout => 120,
      async => 0,
      version => 3,
      },
	},
        CustomerKey => 'sAMAccountName',
        # customer #
        CustomerID => 'mail',
        CustomerUserListFields => ['cn', 'mail'],
        CustomerUserSearchFields => ['cn', 'givenname', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit => 250,
        CustomerUserPostMasterSearchFields => ['mail'],
        CustomerUserNameFields => ['givenname', 'sn'],
        CustomerUserExcludePrimaryCustomerID => 0,
        AdminSetPreferences => 0,
        CacheTTL => 120,
        Map => [
            # note: Login, Email and CustomerID are mandatory!
            # if you need additional attributes from AD, just map them here.
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
            [ 'UserFirstname',  'Firstname',   'givenname',       1, 1, 'var', '', 0 ],
            [ 'UserLastname',   'Lastname',    'sn',              1, 1, 'var', '', 0 ],
            [ 'UserLogin',      'Username',    'sAMAccountName',             1, 1, 'var', '', 0 ],
            [ 'UserEmail',      'Email',       'mail',            1, 1, 'var', '', 0 ],
            [ 'UserCustomerID', 'CustomerID',  'mail',            0, 1, 'var', '', 0 ],
            [ 'UserPhone',      'Phone',      'telephoneNumber', 1, 0, 'var', '', 0 ],
            [ 'UserMobile',     'Mobile',      'mobile', 1, 0, 'var', '', 0 ],
            [ 'UserRoom',       'Room',        'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],
        ],
  };   
   
    $Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'server2.smosh.local';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=smosh, dc=local';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #           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;
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by crythias »

Name => is not a Param. It should come after CustomerUser
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
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

Sorry, very sloppy of me to have made that mistake. Alas, still no change.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by crythias »

What does the Log say?
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
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

As below.

Code: Select all

[Tue May  1 16:06:06 2012][Notice][Kernel::System::Auth::LDAP::Auth] User: joe.blogs (CN=Joe Blogs, ---REMOVED--- DC=smosh,DC=local) authentication ok (REMOTE_ADDR: 10.5.0.17).
[Tue May  1 16:06:06 2012][Error][Kernel::System::Auth::Sync::LDAP::Sync][178] Search failed! (dc=smosh, dc=local) filter='(sAMAccountName=joe.blogs)' 000004DC: LdapErr: DSID-0C0906DD, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v17722
[Tue May  1 16:06:06 2012][Error][Kernel::System::User::UserLookup][797] No UserID found for 'joe.blogs'!
[Tue May  1 16:06:06 2012][Error][Kernel::System::User::UserLookup][797] No UserID found for 'joe.blogs'!
[Tue May  1 16:06:06 2012][Notice][Kernel::System::User::GetUserData] Panic! No UserData for user: 'joe.blogs'!!!
So it's failing to find a sAMAccountName=joe.blogs in the OTRS DB?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by crythias »

In order to perform this operation a successful bind must be completed on the connection.
This is connection/credential related.

Also, this user is being tested as an agent, not as a customer. (log on to customer.pl, not index.pl)
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
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

Wow, that's me being pretty stupid!

Customers can login via the customers.pl - I'd not want them able to login as agents at all is that easy to disable so that they get a 'login failed' message rather than this sync issue?

There will be very few agents on the system (2 or 3).
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by crythias »

Yes. Assign agents to an LDAP/AD group and filter authentication on that.
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
dbendon
Znuny newbie
Posts: 11
Joined: 26 Apr 2012, 11:24
Znuny Version: 3.1.4

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!

Post by dbendon »

Magic, I'll use the IT Admins OU group.

Thanks for all your help, I think I might just have a running helpdesk system thanks to you, now to seach for some single sign on stuff!
gopalakrishnan
Znuny newbie
Posts: 29
Joined: 16 Apr 2015, 11:04
Znuny Version: 4.0.5
Real Name: Gopalakrishnan
Company: Siva group

Re: AD/LADP Issue "...no user data can be found in OTRS DB!!"

Post by gopalakrishnan »

hi, i am also having the same problem, the solutions that explained above are very useful to me, but still am having the problem
""Panic, user authenticated but no user data can be found in OTRS DB!! Perhaps the user is invalid.""

Customer login successfully for all users but for Agents it gives this error, please give me the suggestions

in index.pl page.

Code: Select all

 # This is an example configuration for using an MS AD backend
    $Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host1'} = '10.110.32.45';
    $Self->{'AuthModule::LDAP::BaseDN1'} = 'CN=Users,dc=shatest,dc=com';
    $Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';
 
    # Check if the user is allowed to auth in a posixGroup
    # (e. g. user needs to be in a group OTRS_Agents to use otrs)
    $Self->{'AuthModule::LDAP::GroupDN1'} = 'CN=otrs_allow_A,CN=Users,DC=shatest,DC=com';
    $Self->{'AuthModule::LDAP::AccessAttr1'} = 'member';
    $Self->{'AuthModule::LDAP::UserAttr1'} = 'DN';
 
    # Bind credentials to log into AD
    $Self->{'AuthModule::LDAP::SearchUserDN1'} = 'CN=otrs_ldap,CN=Users,DC=shatest,DC=com';
    $Self->{'AuthModule::LDAP::SearchUserPw1'} = 'apr@123';
 
    # 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::AlwaysFilter1'} = '';
 
    # 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'} = '';
 
    # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
    $Self->{'AuthModule::LDAP::Params1'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
 	sscope => 'sub'
    };
  
    # Now sync data with OTRS DB
    $Self->{'AuthSyncModule1'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host1'} = '10.110.32.45';
    $Self->{'AuthSyncModule::LDAP::BaseDN1'} = 'CN=Users,dc=CHE-SVL-FTP-01,dc=shatest,dc=com';
    $Self->{'AuthSyncModule::LDAP::UID1'} = 'sAMAccountName';
    $Self->{'AuthSyncModule::LDAP::SearchUserDN1'} = 'CN=otrs_ldap,CN=Users,DC=shatest,DC=com';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw1'} = 'apr@123';
 
    $Self->{'AuthSyncModule::LDAP::UserSyncMap1'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };
    # UserSyncLDAPGroups
    # (If "LDAP" was selected for AuthModule, you can specify
    # initial user groups for first login.)
    #$Self->{UserSyncLDAPGroups} = [
     #   'users',
    #];
 
    # AuthSyncModule::LDAP::UserSyncInitialGroups
    # (sync following group with rw permission after initial create of first agent
    # login)
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups1'} = [
        'customer_user',
    ];
Locked