LDAP authentication
- Edited
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.
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.
- Edited
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
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:
- https://github.com/osTicket/osTicket/pull/6071
- https://github.com/osTicket/osTicket/pull/6080
- https://github.com/osTicket/osTicket/pull/6087
- https://github.com/osTicket/osTicket/pull/6088
- https://github.com/osTicket/osTicket/pull/6089
- https://github.com/osTicket/osTicket/pull/6096
- https://github.com/osTicket/osTicket/pull/6099
Cheers.
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!
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.
Re-download and re-install the latest plugin from our website. We had issues with the new downloader and it wasn't downloading the correct version.
Cheers.
- Edited
I redownloaded it, but am still having the same problem after disabling the plugin, deleting it, re-installing, and re-configuring. Though, the error is different now:
[Fri Jun 24 12:29:52.871366 2022] [php:error] [pid 36521] [client 192.168.1.2:50211] PHP Fatal error: Uncaught ArgumentCountError: ldap_first_attribute() expects exactly 2 arguments, 3 given in phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php:367\nStack trace:\n#0 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(367): ldap_first_attribute()\n#1 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()\n#2 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->__construct()\n#3 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()\n#4 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()\n#5 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1505): Net_LDAP2_RootDSE::fetch()\n#6 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Schema.php(136): Net_LDAP2->rootDse()\n#7 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1563): Net_LDAP2_Schema::fetch()\n#8 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(360): Net_LDAP2->schema()\n#9 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()\n#10 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->__construct()\n#11 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()\n#12 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()\n#13 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1505): Net_LDAP2_RootDSE::fetch()\n#14 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/authentication.php(262): Net_LDAP2->rootDse()\n#15 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/authentication.php(193): LDAPAuthentication->getSchema()\n#16 phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/authentication.php(479): LDAPAuthentication->authenticate()\n#17 /var/www/html/osTicket/include/class.auth.php(249): ClientLDAPAuthentication->authenticate()\n#18 /var/www/html/osTicket/login.php(51): AuthenticationBackend::process()\n#19 {main}\n thrown in phar:///var/www/html/osTicket/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php on line 367, referer: https://helpdesk.beeblebrox.com/osTicket/login.php
I am also receiving the same error message. I have also downloaded the latest version of the LDAP plug in from the website. Deleted and completely removed the plug in but it still gives the same PHP fatal error.
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ArgumentCountError: ldap_first_attribute() expects exactly 2 arguments, 3 given in phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php:367\nStack trace:\n#0 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(367): ldap_first_attribute()\n#1 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()\n#2 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->__construct()\n#3 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()\n#4 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()\n#5 phar:///var/www/html/...', referer: https://helpdesk.shookhome.org/login.php
I have noticed that if I explicitly set the LDAP Schema to Active Directory, I get a login denial from osTicket when attempting to log in as an AD user. However, on the AD server, I see a successful logon attempt for my user.
It's still broken with autodetect.
KevinTheJedi Hi KevinTheJedi,
This is still broken with Autodetect set. I really don't know what else to do. Seems like an issue with the plugin code as something extra is being passed to a function that I'm not able to debug.
I don’t know what to tell you. We addressed this issue already with the below commit:
Either your server is caching the old plugin or you are not installing the latest version of the plugin.
Cheers.
- Edited
i also installed the last plugin for 1.16.3 from the download page but still have issues.
[Thu Jul 07 12:31:08.970941 2022] [php:error] [pid 1115] [client ...:47096] PHP Fatal error: Uncaught ArgumentCountError: ldap_first_attribute() expects exactly 2 arguments, 3 given in phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php:367\nStack trace:\n#0 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(367): ldap_first_attribute()\n#1 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()\n#2 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->construct()\n#3 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()\n#4 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()\n#5 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1505): Net_LDAP2_RootDSE::fetch()\n#6 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Schema.php(136): Net_LDAP2->rootDse()\n#7 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1563): Net_LDAP2_Schema::fetch()\n#8 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(360): Net_LDAP2->schema()\n#9 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()\n#10 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->construct()\n#11 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()\n#12 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()\n#13 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1505): Net_LDAP2_RootDSE::fetch()\n#14 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(620): Net_LDAP2->rootDse()\n#15 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(444): Net_LDAP2->startTLS()\n#16 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(339): Net_LDAP2->performConnect()\n#17 phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/config.php(189): Net_LDAP2->bind()\n#18 /var/www/osTicket/upload/include/class.plugin.php(77): LdapConfig->pre_save()\n#19 /var/www/osTicket/upload/include/class.plugin.php(67): PluginConfig->commitForm()\n#20 /var/www/osTicket/upload/scp/plugins.php(13): PluginConfig->commit()\n#21 {main}\n thrown in phar:///var/www/osTicket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php on line 367, referer: http://.../scp/plugins.php?id=2
I mentioned in another thread about the same issue that we recently changed our downloader for the website and it did have some issue so maybe there are lingering issues. We will look into this.
Cheers.
We have addressed the issue with the downloader. Please re-download, re-install the plugin, and retest.
Cheers.
- Edited
Hi All,
I have similar problem on 1.17 apache and php 8.1.
We will downgrade and we notice.
Update:
After downgrade PHP to 8.0, LDAP plugin works fine.