Page 1 of 1

[Solved] LDAP works, but don't

Posted: Fri Jul 09, 2021 8:05 pm
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?

Re: LDAP works, but don't

Posted: Sun Jul 11, 2021 2:02 pm
by Thorsten
Hi,

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

bye
Thorsten

Re: LDAP works, but don't

Posted: Mon Jul 12, 2021 2:27 pm
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

Re: LDAP works, but don't

Posted: Tue Jul 13, 2021 5:08 pm
by Thorsten
Hi,

which version do you use?

bye
Thorsten

Re: LDAP works, but don't

Posted: Tue Jul 13, 2021 5:49 pm
by etcho
I'm currently on 3.1.0-beta, but it had the same behavior before I installed the beta version.

Re: LDAP works, but don't

Posted: Tue Jul 13, 2021 8:54 pm
by Thorsten
Hi,

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

Thanks for testing the beta!

bye
Thorsten

Re: LDAP works, but don't

Posted: Wed Jul 14, 2021 5:48 pm
by etcho
Thanks, Thorsten. It solved the problem.