nseibert / ldap

LDAP Extension for TYPO3 CMS
3 stars 3 forks source link

FE login not working in TYPO3 7.6 #21

Closed wintgen closed 4 years ago

wintgen commented 5 years ago

After trying to log in to a page with a frontend login plugin a login failure with the following message is displayed:

array(4 items)
   caller => 'TYPO3\CMS\Core\Database\DatabaseConnection::exec_INSERTquery' (60 chars)
   ERROR => 'Column 'ses_userid' cannot be null' (34 chars)
   lastBuiltQuery => 'INSERT INTO fe_sessions (ses_id,ses_name,ses_iplock,ses_hashlock,ses_userid,
      ses_tstamp,ses_data,ses_permanent) VALUES ('23cd9697c5a066754cd6a540de61ff24
      ','fe_typo_user','132.195','238165933',NULL,'1540481837','','0')' (216 chars)
   debug_backtrace => 'call_user_func#34 // {closure}# // TYPO3\CMS\Frontend\Http\Application->run#
      33 // TYPO3\CMS\Core\Core\Bootstrap->handleRequest#78 // TYPO3\CMS\Frontend\
      Http\RequestHandler->handleRequest#308 // TYPO3\CMS\Frontend\Controller\Typo
      ScriptFrontendController->initFEuser#118 // TYPO3\CMS\Frontend\Authenticatio
      n\FrontendUserAuthentication->start#1086 // TYPO3\CMS\Core\Authentication\Ab
      stractUserAuthentication->start#179 // TYPO3\CMS\Core\Authentication\Abstrac
      tUserAuthentication->checkAuthentication#423 // TYPO3\CMS\Frontend\Authentic
      ation\FrontendUserAuthentication->createUserSession#724 // TYPO3\CMS\Core\Au
      thentication\AbstractUserAuthentication->createUserSession#265 // TYPO3\CMS\
      Core\Database\DatabaseConnection->exec_INSERTquery#840 // TYPO3\CMS\Core\Dat
      abase\DatabaseConnection->debug#223' (795 chars)

However the devlog shows that the extension was able to authenticate the user and mapped the properties correctly:

getUser() called, loginType: FE
Configuration for server "ldapserver." loaded successfully
Try to authenticate with server: ldapserver
Query server "ldapserver" with filter: (uid=dummy)
Found 1 records
...
User authenticated successfully dummy
Login successful
function "authUser" returns: 200

But the group and user are not correctly stored in the database:

mysql> select * from fe_groups;
+-----------------+-----+-----+--------+--------+-----------+-------+--------+--------------+---------+-------------+----------+----------+---------------------+-------------------+------------+-----------------+
| tx_extbase_type | uid | pid | tstamp | crdate | cruser_id | title | hidden | lockToDomain | deleted | description | subgroup | TSconfig | felogin_redirectPid | tx_ldap_serveruid | tx_ldap_dn | tx_ldap_lastrun |
+-----------------+-----+-----+--------+--------+-----------+-------+--------+--------------+---------+-------------+----------+----------+---------------------+-------------------+------------+-----------------+
| 0               |   1 |   8 |      0 |      0 |         0 |       |      0 |              |       0 | NULL        | NULL     | NULL     | NULL                | ldapserver        |            |                 |
+-----------------+-----+-----+--------+--------+-----------+-------+--------+--------------+---------+-------------+----------+----------+---------------------+-------------------+------------+-----------------+

mysql> select * from fe_users; -- tx_ldap_dn has been anonymized
+-----------------+-----+-----+--------+----------+----------+-----------+---------+-----------+---------+------+------------+-------------+-----------+---------+-----------+-----+-------+--------+-----------+--------------+---------+------+-------+-----+------+---------+-----+---------+-------+----------+--------------+-----------+-----------+---------------------+--------------------+-------------------+------------+---------------+-----------------+
| tx_extbase_type | uid | pid | tstamp | username | password | usergroup | disable | starttime | endtime | name | first_name | middle_name | last_name | address | telephone | fax | email | crdate | cruser_id | lockToDomain | deleted | uc   | title | zip | city | country | www | company | image | TSconfig | fe_cruser_id | lastlogin | is_online | felogin_redirectPid | felogin_forgotHash | tx_ldap_serveruid | tx_ldap_dn | tx_ldap_nosso | tx_ldap_lastrun |
+-----------------+-----+-----+--------+----------+----------+-----------+---------+-----------+---------+------+------------+-------------+-----------+---------+-----------+-----+-------+--------+-----------+--------------+---------+------+-------+-----+------+---------+-----+---------+-------+----------+--------------+-----------+-----------+---------------------+--------------------+-------------------+------------+---------------+-----------------+
| 0               |   1 |   8 |      0 |          |          | NULL      |       0 |         0 |       0 |      |            |             |           |         |           |     |       |      0 |         0 |              |       0 | NULL |       |     |      |         |     |         | NULL  | NULL     |            0 |         0 |         0 | NULL                |                    | ldapserver        | xxxxxxxxxx |             0 |                 |
+-----------------+-----+-----+--------+----------+----------+-----------+---------+-----------+---------+------+------------+-------------+-----------+---------+-----------+-----+-------+--------+-----------+--------------+---------+------+-------+-----+------+---------+-----+---------+-------+----------+--------------+-----------+-----------+---------------------+--------------------+-------------------+------------+---------------+-----------------+

This happens on TYPO3 6.2 installations which have been upgraded to TYPO3 7.6 as well as fresh 7.6 installations. The config that worked in 6.2 is untouched.