[Solved] LDAP customers: customer_user_id & login ID

Moderator: crythias

Locked
rmstrath
Znuny newbie
Posts: 9
Joined: 27 Mar 2014, 14:33
Znuny Version: 3.3.5
Real Name: Richard Martin
Company: University of Strathclyde

[Solved] LDAP customers: customer_user_id & login ID

Post by rmstrath »

Please help!

Customers are able to authenticate and login using their LDAP Active Directory credentials. They can create tickets via the web interface and these are visible under "My Tickets".

However, any tickets submitted via email (as well as web tickets) are visible under "Company Tickets" (CompanyID is set to 'mail').

Problem is customer_user_id of email tickets is set to the email address forename.suraname@institution, but customer_user_id of webtickets is set to the login ID (sAMAccountName).

Ideally, everything should be visible under "My Tickets" rather than "Company Tickets".

I think there are two options:

1. perform an LDAP query on incoming email tickets to find sAMAccountName and set customer_user_id=sAMAccountName
2. have customers authenticate using their AD userID (sAMAccountName) but use the email address as the login ID and consequently have customer_user_id = email address for any web tickets.

But I don't know how to do either. Any help or alternative suggestions would be most appreciated.

Richard.
Last edited by rmstrath on 28 Mar 2014, 14:22, edited 1 time in total.
OTRS version 3.3.5, Linux (Centos 6.5) & MySQL 5.1.73
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: LDAP customers: customer_user_id & login ID

Post by crythias »

rmstrath wrote:Problem is customer_user_id of email tickets is set to the email address forename.suraname@institution,
This is because your Config.pm of CustomerUser Map is referencing a field lookup for the email address that it can't find in ldap to match to a user.

What is your Config.pm?
rmstrath wrote:Ideally, everything should be visible under "My Tickets" rather than "Company Tickets".
"My Tickets = current username" "Company Tickets = "customer_id""

viewtopic.php?f=60&t=16543
viewtopic.php?f=60&t=7531
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
rmstrath
Znuny newbie
Posts: 9
Joined: 27 Mar 2014, 14:33
Znuny Version: 3.3.5
Real Name: Richard Martin
Company: University of Strathclyde

Re: LDAP customers: customer_user_id & login ID

Post by rmstrath »

This is because your Config.pm of CustomerUser Map is referencing a field lookup for the email address that it can't find in ldap to match to a user.
Are you saying that the OTRS attempts an LDAP search based on the email address for incoming tickets? When logging in via the web interface, it correctly matches a userid -> email address since I can see all the "company tickets" which have customer_id = email address (CustomerID => 'mail' in config below).

From my Config.pm

Code: Select all

      CustomerKey => 'sAMAccountName',
      CustomerID => 'mail',
      #CustomerID => '[customer_id]',
      CustomerUserListFields => ['sAMAccountName', 'sn', 'givenname', 'company',  'mail'],
      CustomerUserSearchFields => ['sAMAccountName', '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', 'mail', 0, 1, 'var' ],
        [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
        [ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
        [ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
      ],
    };
"My Tickets = current username" "Company Tickets = "customer_id""
I know, but "current username" = AD userID & "customer_id" / "customer_user_id" = incoming email address for email tickets.

I've already read both of the linked topics, but still couldn't figure it out.

Thanks.
OTRS version 3.3.5, Linux (Centos 6.5) & MySQL 5.1.73
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: LDAP customers: customer_user_id & login ID

Post by crythias »

rmstrath wrote:Are you saying that the OTRS attempts an LDAP search based on the email address for incoming tickets?
Yes, it's practically the only user-identifying feature on a ticket.
Summary: check "from" address vs CustomerUserPostMasterSearchFields => ['mail'],
rmstrath wrote:When logging in via the web interface, it correctly matches a userid -> email address since I can see all the "company tickets" which have customer_id = email address (CustomerID => 'mail' in config below).
Which makes sense, because the user asserts a login name at the web interface.

So, the real question is if the mail from address is different from LDAP mail stored attribute for given user.
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
rmstrath
Znuny newbie
Posts: 9
Joined: 27 Mar 2014, 14:33
Znuny Version: 3.3.5
Real Name: Richard Martin
Company: University of Strathclyde

Re: LDAP customers: customer_user_id & login ID

Post by rmstrath »

So, the real question is if the mail from address is different from LDAP mail stored attribute for given user.
Don't think so. Email ticket from address:

Code: Select all

From: Archie contact <contact-archie@xxxxx.xx.xx>
LDAP query on userid:

Code: Select all

mail: contact-archie@xxxxx.xx.xx; 
Any ideas?

Many thanks.
OTRS version 3.3.5, Linux (Centos 6.5) & MySQL 5.1.73
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: LDAP customers: customer_user_id & login ID

Post by crythias »

any errors?
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
rmstrath
Znuny newbie
Posts: 9
Joined: 27 Mar 2014, 14:33
Znuny Version: 3.3.5
Real Name: Richard Martin
Company: University of Strathclyde

Re: LDAP customers: customer_user_id & login ID

Post by rmstrath »

any errors?
Sorry - none.
OTRS version 3.3.5, Linux (Centos 6.5) & MySQL 5.1.73
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: LDAP customers: customer_user_id & login ID

Post by crythias »

Please edit your signature (see mine) so I can follow along with your OTRS Version, OS, database

Did you make changes to SysConfig as well as Config.pm for LDAP lookup?
For a ticket that is sent via email, what's the user information attached? does it look like Customer Information is there on ticket zoom or is it blank as if random person submitted it?
What's the username attached to the ticket?
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
rmstrath
Znuny newbie
Posts: 9
Joined: 27 Mar 2014, 14:33
Znuny Version: 3.3.5
Real Name: Richard Martin
Company: University of Strathclyde

Re: LDAP customers: customer_user_id & login ID

Post by rmstrath »

Did you make changes to SysConfig as well as Config.pm for LDAP lookup?
No, but I set CustomerGroupSupport = Yes & CustomerGroupAlwaysGroups = users in Framework -> Frontend::Customer
For a ticket that is sent via email, what's the user information attached? does it look like Customer Information is there on ticket zoom or is it blank as if random person submitted it?
What's the username attached to the ticket?
There is no customer information or username visible on the ticket zoom - only the senders email address.

Customer Information reports "none"
Ticket Type reports "customer – email-external"
"From" reports the senders email address & CustomerID under the Ticket Information is the same email address.

Your help is much appreciated. Thanks.
OTRS version 3.3.5, Linux (Centos 6.5) & MySQL 5.1.73
rmstrath
Znuny newbie
Posts: 9
Joined: 27 Mar 2014, 14:33
Znuny Version: 3.3.5
Real Name: Richard Martin
Company: University of Strathclyde

[Solved] LDAP customers: customer_user_id & login ID

Post by rmstrath »

Solved! ... but its late. Will tidy up and post solution tomorrow ... :)
OTRS version 3.3.5, Linux (Centos 6.5) & MySQL 5.1.73
rmstrath
Znuny newbie
Posts: 9
Joined: 27 Mar 2014, 14:33
Znuny Version: 3.3.5
Real Name: Richard Martin
Company: University of Strathclyde

[Solved] LDAP customers: customer_user_id & login ID

Post by rmstrath »

After reading several posts, I can across one which suggested removing GroupDN from the LDAP search and changed CustomerUserValidFilter => '(company=*) to CustomerUserValidFilter => '(mail=*)'. We don't have a company tag in our user records, so that explains the null search in part. Don't know why GroupDN causes a problem.

Anyway working code is:

Code: Select all

    $Self->{CustomerUser} = {
      Name => 'LDAP Lookup',
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
        Host => 'XXXXXXXXXXX',
        BaseDN => 'XXXXXXXXXXXXXXXXX',
        SSCOPE => 'sub',
        UserDN => 'cn=XXXXX,ou=XXXXXXX,ou=XXXXX,dc=XX,dc=XXXX,dc=XX,dc=XX',
        UserPw => 'XXXXXXXX',
        AlwaysFilter => '',
      # GroupDN => 'ou=XXXXX,dc=XX,dc=XXXXX,dc=XX,dc=XX',
      # AccessAttr => 'member',
      # UserAttr => 'DN',
      },
      CustomerKey => 'sAMAccountName',
      CustomerID => 'mail',
      CustomerUserListFields => ['sAMAccountName', 'sn', 'givenname', 'company',  'mail'],
      CustomerUserSearchFields => ['sAMAccountName', 'sn', 'givenname', 'company', 'mail'],
      CustomerUserPostMasterSearchFields => ['mail'],
      CustomerUserNameFields => ['givenname', 'sn'],
      CustomerUserValidFilter => '(mail=*)(lockoutTime=0)',
      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', 'mail', 0, 1, 'var' ],
        [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
        [ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
        [ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
      ],
    };
Now, incoming tickets are properly mapped to the LDAP userID and both email & web tickets can be viewed under "My Tickets" by the Customer. In fact, any ticket can be updated either by email or via the customer.pl interface - perfect!
OTRS version 3.3.5, Linux (Centos 6.5) & MySQL 5.1.73
Locked