Loading...
 
Skip to main content

LDAP - forced to login twice

Status
Open
Subject
LDAP - forced to login twice
Version
17.x
Category
  • Usability
Feature
External Authentication (LDAP, AD, PAM, CAS, etc)
Resolution status
New
Submitted by
ihtus
Lastmod by
ihtus
Rating
(1)
Description

Installed a fresh tikiwiki 17.1.
Enabled and configured LDAP.

When trying to login, getting this error in frontend:
"Authentication error"

Had to login second time in order to be logged in.

Here are the LDAP logs:

Copy to clipboard
UserLib::validate_user_ldap() Connect Host: ldap://192.168.1.1:389. Binddn: acovali@magna.global at line 225 in /srv/www/htdocs/wiki/lib/auth/ldap.php Searching for user information with filter: (sAMAccountName=acovali) at line 278 in /srv/www/htdocs/wiki/lib/auth/ldap.php Connect Host: ldap://192.168.1.1:389. Binddn: CN=First Last Name,OU=IT,OU=Accounts,OU=PFT,OU=America,OU=Cosma,OU=Magna Group,DC=magna,DC=global at line 225 in /srv/www/htdocs/wiki/lib/auth/ldap.php Bind successful. UsersLib::ldap_sync_user_data() UserLib::disable_tiki_auth()



Analyzed /lib/userslib.php, line 904 - 932

It's not getting in "if ($result == USER_VALID)" because $result is a string that is a username

Copy to clipboard
$result = $this->add_user($user, $pass, $email);


If I replace it with

Copy to clipboard
$result2 = $this->add_user($user, $pass, $email);


$result now would get value from

Copy to clipboard
$result = $this->validate_user_ldap($user, $pass);



So this edit fixed the issue, and I was able to be logged in after first login attempt

Copy to clipboard
$result2 = $this->add_user($user, $pass, $email);
Importance
5
Priority
25
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
6473
Created
Tuesday 31 October, 2017 13:46:39 UTC
by ihtus
LastModif
Wednesday 01 November, 2017 12:18:44 UTC


Show PHP error messages