Unable to add and authenticate staff / user using LDAP though the plugin is configured successfully!

Packages in use are: osTicket (v1.16.1), NGINX (v1.21.6), MySQL (8.0.28), pHp (v8.0.16), LDAP Plug-in (v0.6.2).

NGINX Error.log trace:
#2 /usr/share/nginx/html/helpdesk/upload/include/class.auth.php(249): ClientLDAPAuthentication->authenticate()
#3 /usr/share/nginx/html/helpdesk/upload/login.php(52): AuthenticationBackend::process()
#4 {main}
thrown in phar:///usr/share/nginx/html/helpdesk/upload/include/plugins/auth-ldap.phar/authentication.php on line 262PHP message: PHP Fatal error: Uncaught TypeError: ldap_close(): Argument #1 ($ldap) must be of type resource, bool given in phar:///usr/share/nginx/html/helpdesk/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php:701
Stack trace:
#0 phar:///usr/share/nginx/html/helpdesk/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(701): ldap_close()
#1 /usr/share/nginx/html/helpdesk/upload/include/pear/PEAR.php(755): Net_LDAP2->_Net_LDAP2()
#2 [internal function]: _PEAR_call_destructors()
#3 {main}
thrown in phar:///usr/share/nginx/html/helpdesk/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php on line 701" while reading response header from upstream, client: 192.168…., server: helpdesk….., request: "POST /login.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "helpdesk….", referrer: "https://helpdesk…./open.php"

    php8.0-ldap is already installed, checked that again with php -m, it’s there.
    Any other step required to enable that? Using Ubuntu 20.04 with NGINX.

    php-ldap is enable, pic attached. However, authentication still not happening! Post Sign-In, HTTP 500 is displayed!

      deepak_22777

      Well you are using NGINX which isn’t fully supported out of the box. There are many guides online that explain how to get osTicket working with NGINX. If you want full support out of the box then use Apache or IIS.

      Cheers.

      Auth working fine now, post installing php8.0-ldap and php-ldap.
      Several times, getting HTTP 500, on retry works well. Shall look into this to resolve.

      Thanks!

      I am running IIS10 / PHP8.0.16 and recently got a similar LDAP error (See below). A restart of IIS and I was good to again. Thought I'd post this just in case it's of value to the DEV team.


      [02-Mar-2022 16:15:18 UTC] PHP Fatal error: Uncaught Error: Call to a member function bind() on null in phar://C:/inetpub/wwwroot/osTicket/include/plugins/auth-ldap.phar/authentication.php:223
      Stack trace:
      #0 phar://C:/inetpub/wwwroot/osTicket/include/plugins/auth-ldap.phar/authentication.php(430): LDAPAuthentication->authenticate()
      #1 C:\inetpub\wwwroot\osTicket\include\class.auth.php(249): StaffLDAPAuthentication->authenticate()
      #2 C:\inetpub\wwwroot\osTicket\scp\login.php(71): AuthenticationBackend::process()
      #3 {main}
      thrown in phar://C:/inetpub/wwwroot/osTicket/include/plugins/auth-ldap.phar/authentication.php on line 223
      [02-Mar-2022 16:15:18 UTC] PHP Fatal error: Uncaught TypeError: ldap_close(): Argument #1 ($ldap) must be of type resource, bool given in phar://C:/inetpub/wwwroot/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2.php:701
      Stack trace:
      #0 phar://C:/inetpub/wwwroot/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(701): ldap_close()
      #1 C:\inetpub\wwwroot\osTicket\include\pear\PEAR.php(755): Net_LDAP2->_Net_LDAP2()
      #2 [internal function]: _PEAR_call_destructors()
      #3 {main}
      thrown in phar://C:/inetpub/wwwroot/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2.php on line 701

      We tried the whole day today and noticed the blank page, post Sign In, appears few times only.
      Couple of Authentication / Sign In try again works smooth, without touching or restarting any service!

      @BPS-IT

      It sounds like your issue is not installing/enabling the php-ldap extension.

      Cheers.

      If that were the case, why does the IIS Restart correct the issue? And the php-ldap extension is very much enabled.

      @BPS-IT

      Not sure. Definitely sounds like a setup issue though as my LDAP has no issues.

      Cheers.

      14 days later

      OS (Ubuntu 20.04) ,osTicket (v1.16.1), Apache (2.4.41), MySQL (10.3.34), PHP (v8.0.16), LDAP Plug-in (v0.6.2)

      I have the same issue and log error when trying to authenticate user via ldap. Login prompt shows 'access denied' and display the log below in /var/log/apache2/osticket_error.log.

      PHP Fatal error: Uncaught TypeError: ldap_free_result(): Argument #1 ($ldap) must be of type resource, bool given in phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php:501\nStack trace:\n#0 phar:///var/www/osTicket/upload/in clude/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(501): ldap_free_result()\n#1 /var/www/osTicket/upload/include/pear/PEAR.php(755): Net_LDAP2_Search->_Net_LDAP2_Search() \n#2 [internal function]: _PEAR_call_destructors()\n#3 {main}\n thrown in phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php on line 50 1

      php8.0-ldap and php-ldap installed and ldap module enabled. Restarted Apache but same errror. 'php -m' does show ldap. Am I missing something? Could someone point me to the right direction?

      Appreciated.

        kewl

        Did you download and install the latest version of the plugin from our website? I cannot replicate this using v1.16.1, Apache, PHP 8.0, MySQL 8.0, and the latest version of the LDAP plugin.

        Cheers.

        Yes, I did.

        I downloaded auth-ldap.phar from osticket.com and copied it to /var/www/osTicket/upload/include/plugins/ and enabled from the admin console.

        php8.0 modules installed:
        php8.0-apcu php8.0-bcmath php8.0-cgi php8.0-cli php8.0-common php8.0-fpm php8.0-gd php8.0-imap php8.0-intl php8.0-ldap php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-xml

        MYSQL is 10.3.34. I made a typo earlier and have corrected the post.

        Thanks

        @kewl

        I don’t know what’s going on then. Typically when this happens it’s either the extension is not installed or the LDAP info is incorrect.

        Look around for any other related errors. Also, you can try applying the latest patches to see if it’s due to a bug that’s been fixed:

        Cheers.

        3 months later

        If you have the "Audit" plugin installed try disabling it. We disabled that plugin and then LDAP started working again after our upgrade from 1.15 to 1.16. Kinda puts us out of compliance without the audit plugin, but at least it works!

          10 days later

          I am also having issues with the LDAP plugin, after upgrading to 1.16.3, ensuring the LDAP PHP library is loaded, and re-installing the latest version of the LDAP plugin from GitHub.

          [Wed Jun 22 18:52:43.599893 2022] [php:error] [pid 578] [client 192.168.50.2:51683] PHP Fatal error: Uncaught Error: Call to undefined method PEAR_Error::getValue() in phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/authentication.php:262\nStack trace:\n#0 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/authentication.php(190): LDAPAuthentication->getSchema()\n#1 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/authentication.php(476): LDAPAuthentication->authenticate()\n#2 /var/www/html/osTicket/include/class.auth.php(249): ClientLDAPAuthentication->authenticate()\n#3 /var/www/html/osTicket/login.php(51): AuthenticationBackend::process()\n#4 {main}\n thrown in phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/authentication.php on line 262, referer: https://helpdesk.beeblebrox.com/osTicket/login.php

          Would appreciate any hints. LDAP authentication succeeded when configuring the plugin after the upgrade. I get a blank page when attempting to log in as a domain user.