[Solved] LDAP works, but don't

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
etcho
Posts: 4
Joined: Tue Jul 02, 2019 7:00 pm

[Solved] LDAP works, but don't

Post by etcho »

Hello there.

I'm trying to configure LDAP authentication on my faq. After editing the ldap config file, I am able to know that it works, but I don't pass through authentication.

Explaining, I have an account on my LDAP server and another account on the faq with the same username. If I try enter with my username and my faq password, it works. If I enter a wrong password (different of my ldap's and faq's password), I got a wrong username or password message. But if I enter the username and the correct LDAP password, I got a 500 error code, with the chrome's default error screen. When testing with prefix (server\user), same thing happens.

I assume that the LDAP authentication is working, because I only get an error when I enter the right LDAP credentials, so the application is able to check if my password is correct or not, showing the right message for wrong password when needed.

Any ideas?
Last edited by etcho on Wed Jul 14, 2021 5:49 pm, edited 1 time in total.
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP works, but don't

Post by Thorsten »

Hi,

could you please enable the debug mode in src/Bootstrap.php and try it again?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
etcho
Posts: 4
Joined: Tue Jul 02, 2019 7:00 pm

Re: LDAP works, but don't

Post by etcho »

Hi. Thanks for the reply.

Here is the error message:

phpMyFAQ Fatal error
Uncaught exception: 'TypeError'

Message: 'Argument 2 passed to phpMyFAQ\User::createUser() must be of the type string, null given, called in /var/www/html/dds/phpmyfaq/src/phpMyFAQ/Auth/AuthLdap.php on line 82'

Stack trace:

#0 /var/www/html/dds/phpmyfaq/src/phpMyFAQ/Auth/AuthLdap.php(82): phpMyFAQ\User->createUser()
#1 /var/www/html/dds/phpmyfaq/src/phpMyFAQ/Auth/AuthLdap.php(192): phpMyFAQ\Auth\AuthLdap->create()
#2 /var/www/html/dds/phpmyfaq/src/phpMyFAQ/User/CurrentUser.php(211): phpMyFAQ\Auth\AuthLdap->checkCredentials()
#3 /var/www/html/dds/phpmyfaq/admin/index.php(156): phpMyFAQ\User\CurrentUser->login()
#4 {main}
Thrown in '/var/www/html/dds/phpmyfaq/src/phpMyFAQ/User.php' on line 449
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP works, but don't

Post by Thorsten »

Hi,

which version do you use?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
etcho
Posts: 4
Joined: Tue Jul 02, 2019 7:00 pm

Re: LDAP works, but don't

Post by etcho »

I'm currently on 3.1.0-beta, but it had the same behavior before I installed the beta version.
Thorsten
Posts: 15559
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP works, but don't

Post by Thorsten »

Hi,

that should fix your errors: https://github.com/thorsten/phpMyFAQ/commit/eb948a809b698fd2aac1e851d457057b63125bb8

Thanks for testing the beta!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
etcho
Posts: 4
Joined: Tue Jul 02, 2019 7:00 pm

Re: LDAP works, but don't

Post by etcho »

Thanks, Thorsten. It solved the problem.
Post Reply