User needs to login again when opening a new ticket - LDAP

Moderator: crythias

Locked
maxymus
Znuny newbie
Posts: 3
Joined: 23 Jul 2014, 17:12
Znuny Version: 3.3.8-01

User needs to login again when opening a new ticket - LDAP

Post by maxymus »

Hello,

I am having this issue right now, (this is my third installation and the first 2 didn't had it) where the customer log in successfully via LDAP, but then he tries to open a new ticket, the page then asks him to login again so he can create a new ticket.

Is it a Permission problem?
This time I run the bin/otrs.SetPermissions.pl to get it working (the apache user was not default).

The logs:

otrs.log:
[Wed Jul 23 11:59:19 2014][Notice][Kernel::System::CustomerAuth::LDAP::Auth] CustomerUser: user (uid=...) authentication ok (REMOTE_ADDR: ...).
apache access log:
(user log in and then try to create a ticket)
<IP> - - [23/Jul/2014:12:22:02 -0300] "POST /helpdesk HTTP/1.1" 302 39 "http://<server>/helpdesk?Action=Logout" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
<IP> - - [23/Jul/2014:12:22:03 -0300] "GET /helpdesk?OTRSCustomerInterface=bzsMVFIjjgNO00j6ottcs3C0waMEeU9c HTTP/1.1" 302 88 "http://<server>/helpdesk?Action=Logout" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
<IP> - - [23/Jul/2014:12:22:04 -0300] "GET /helpdesk?Action=CustomerTicketOverview;Subaction=MyTickets&OTRSCustomerInterface=bzsMVFIjjgNO00j6ottcs3C0waMEeU9c HTTP/1.1" 200 10746 "http://<server>/helpdesk?Action=Logout" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
<IP> - - [23/Jul/2014:12:22:07 -0300] "GET /helpdesk?Action=CustomerTicketMessage HTTP/1.1" 200 7680 "http://<server>/helpdesk?Action=CustomerTicketOverview;Subaction=MyTickets&OTRSCustomerInterface=bzsMVFIjjgNO00j6ottcs3C0waMEeU9c" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"

syslog/messages:
nothing.

only thing I can see weird is the logout message (otrs.log), (the customer, which should be via LDAP, logoff):
[Wed Jul 23 12:24:41 2014][Error][Kernel::System::AuthSession::DB::CheckSessionID][49] Got no SessionID!!
My Config.pm:

Code: Select all

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2014 xxx, 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'} = 'localhost';

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

    # 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};";
    # if you have PostgresSQL 8.1 or earlier, activate the legacy driver with this line:
#    $Self->{DatabasePostgresqlBefore82} = 1;

    # 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"
#    $ENV{ORACLE_HOME} = '/u01/app/oracle/product/10.2.0/client_1';
#    $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
#    $ENV{NLS_LANG} = "american_america.utf8";

#    $Self->{DatabaseDSN} = "DBI:Oracle:sid=OTRS;host=$Self->{DatabaseHost};port=1522;";

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

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
# I tried with 0 and 1 here, uncommented.
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;

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

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


#CustomerUser
# (customer user ldap backend and settings)
    $Self->{CustomerUser} = {
        Name => 'LDAP Backend',
        Module => 'Kernel::System::CustomerUser::LDAP',
	AuthModule => 'Kernel::System::CustomerAuth::LDAP',
	#Module => 'Kernel::System::CustomerAuth::LDAP',
        Params => {
            # ldap host
            Host => '<host>',
            # ldap base dn
            BaseDN => 'ou=People,<dn>',
            # search scope (one|sub)
            SSCOPE => 'sub',
            # The following is valid but would only be necessary if the
            # anonymous user does NOT have permission to read from the LDAP tree
            UserDN => '',
            UserPw => '',
            # in case you want to add always one filter to each ldap query, use
            # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
            AlwaysFilter => '',
            # if both your frontend and your LDAP are unicode, use this:
            SourceCharset => 'utf-8',
            DestCharset   => 'utf-8',
            # if your frontend is unicode and the charset of your
            # ldap server is iso-8859-1, use these options.
            # SourceCharset => 'iso-8859-1',
            # DestCharset => 'utf-8',
            # die if backend can't work, e. g. can't connect to server
            #Die => 0,
            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
                port    => 389,
                timeout => 120,
                async   => 0,
                version => 3,
            },
           # I tried the 'Die' here and above...
            Die => 0,
        },
        # customer unique id
        CustomerKey => 'uid',
        # customer #
        CustomerID => 'uid',
        CustomerUserListFields => ['cn', 'mail'],
        CustomerUserSearchFields => ['uid', 'cn', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit => 500,
        CustomerUserPostMasterSearchFields => ['mail'],
        CustomerUserNameFields => ['givenname', '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 => 100,
        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', 'uid',            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 ],
        ],
    };

#Already tried to un/comment all this lines below, but no difference.
$Self->{'CustomerUser::AuthModule::LDAP::CryptType'} = 'crypt';
#$Self->{'CustomerUser::AuthModule::DB::CryptType'} = 'crypt';
#$Self->{'Customer::DefaultLanguage'} = 'pt_BR';

$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host'} = '<host>';
$Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'ou=People,<dn>';
$Self->{'Customer::AuthModule::LDAP::UID'} = 'uid';
$Self->{'Customer::AuthModule::LDAP::Params'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };
    # ---------------------------------------------------- #
    #                                                      #
    # end of your own config options!!!                    #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
}

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

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

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

1;
Hope you have any tip :)

Thank you!


EDIT:
Sorry, I forgot to add some infos:
OTRS version: 3.3.8-01
OS: SuSE 11 SP2
Apache: 2.2
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: User needs to login again when opening a new ticket - LD

Post by crythias »

apache error log might be of use.
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
maxymus
Znuny newbie
Posts: 3
Joined: 23 Jul 2014, 17:12
Znuny Version: 3.3.8-01

Re: User needs to login again when opening a new ticket - LD

Post by maxymus »

Hi, forgot to add it too, the apache error log says nothing as well.

The only thing the apache error log tells me is the Customer logout error that appears at the otrs.log.

Here it is:

Code: Select all

[Wed Jul 23 12:24:41 2014] [error] [client <IP>] ERROR: OTRS-CGI-87 Perl: 5.10.0 OS: linux Time: Wed Jul 23 12:24:41 2014, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>] , referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]  Message: Got no SessionID!!, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>] , referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]  RemoteAddress: <IP>, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]  RequestURI: /helpdesk?Action=Logout, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>] , referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]  Traceback (19763): , referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]    Module: Kernel::System::AuthSession::DB::CheckSessionID (OTRS 3.3.8) Line: 49, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]    Module: Kernel::System::AuthSession::CheckSessionID (OTRS 3.3.8) Line: 114, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]    Module: Kernel::System::Web::InterfaceCustomer::Run (OTRS 3.3.8) Line: 371, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>]    Module: /opt/otrs/bin/cgi-bin/customer.pl (unknown version) Line: 41, referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
[Wed Jul 23 12:24:41 2014] [error] [client <IP>] , referer: http://<server>/helpdesk?Action=CustomerTicketMessage&OTRSCustomerInterface=gDxxsZL4TNkewlBUiszQ2VRQfb1NG6F3
maxymus
Znuny newbie
Posts: 3
Joined: 23 Jul 2014, 17:12
Znuny Version: 3.3.8-01

Re: User needs to login again when opening a new ticket - LD

Post by maxymus »

I went a little ahead.

I thought the problem might be the Aliases I set for the OTRS:

/etc/apache2/conf.d/otrs.conf

Code: Select all

(...)
ScriptAlias /helpdesk/ "/opt/otrs/bin/cgi-bin/"
Alias /helpdesk "/opt/otrs/bin/cgi-bin/customer.pl"
ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"
(...)
At the Settings > Framework > Core > ScriptAlias I set the same alias:

Code: Select all

helpdesk/
So, I tried to access the old link: /otrs/customer.pl
Logged there and could open a ticket without a problem.

I know this is not OTRS (I guess at least) related, but can you help me to get the alias "helpdesk" working?
Probably the error is, the agent/otrs is at "helpdesk/index.pl" (and others) and I tried to make "helpdesk" the default customer page...

If I only have this custom ScriptAlias, all work fine:

Code: Select all

(...)
ScriptAlias /helpdesk/ "/opt/otrs/bin/cgi-bin/"
(...)
But I wish users could go at the customer.pl when they typed /helpdesk or /helpdesk/ . Can I make it through .htaccess?

Should I move the folder to the /var/www/ (apache root folder), rename it and at the OTRS I change it too?

Thank you again!
Locked