xperseguers / t3ext-ig_ldap_sso_auth

TYPO3 Extension ig_ldap_sso_auth. This extension provides LDAP and SSO support for TYPO3.
https://extensions.typo3.org/extension/ig_ldap_sso_auth
27 stars 68 forks source link

Cannot import user from Backend when using MariaDB #30

Closed ThePinkOne closed 4 years ago

ThePinkOne commented 6 years ago

I can't import users when I use an external database. I can establish a connection to the Active Directory, I can import groups and the user is added, when he logs in. But I can not import one special user via import button. I don't get any kind of error message. I click 'import', the line turns green, I open the Backend users Modul and that the user is not there.

My configuration: TYPO3 v. 8.7.16 MariaDB 10.2.6 (external, not localhost) DB User granted all rights

The strange thing is when I use a database that's installed on the same server (as localhost), import the dump from the external db, grant the same privileges, everything works fine. And how could it be a permission issue when I can import groups manually by clicking the import button?

----- edit ---- I think it's a problem with the MariaDB -Version. Everything works finde with Maria DB v. 5.5 I can not import user via import-Button in MariaDB 10.2

ThePinkOne commented 6 years ago

I found out where the problem is coming from: When you import a user with the function

public static function add($table, array $data = [])

the key 'tstamp' of $data is empty but it has to be an int. It's only empty when you import from backend. As a quick workaround I just wrote

$data['tstamp'] = 0;

before your DB-Insert

$databaseConnection->exec_INSERTquery( $table, $data, false );

Then I figured out that the user is added to be_users after authentification, but most of the information from ldap are missing. This is the insert command for adding an user by authentification

INSERT INTO be_users (pid,tstamp,username,description,avatar,password,admin,usergroup,disable,starttime,endtime,lang,email,db_mountpoints,options,crdate,cruser_id,realName,userMods,allowed_languages,uc,file_mountpoints,file_permissions,workspace_perms,lockToDomain,disableIPlock,deleted,TSconfig,lastlogin,createdByAction,usergroup_cached_list,workspace_id,workspace_preview,category_perms,tx_news_categorymounts,tx_igldapssoauth_dn,tx_igldapssoauth_id) VALUES ('0','0','myUsername','','0','','0','','0','0','0','','',NULL,'3','1530020488','0','',NULL,'',NULL,NULL,'readFolder,writeFolder,addFolder,renameFolder,moveFolder,deleteFolder,readFile,writeFile,addFile,renameFile,replaceFile,moveFile,copyFile,deleteFile','1','','0','0',NULL,'0','0',NULL,'0','1',NULL,'','CN=mycn,OU=mydebt,OU=myUsers,DC=myDC,DC=de','0')

though there're all the information in the $ldapUser array in the Authentication.php (synchroniseUser), they are not used. Is there a reason why?

xperseguers commented 4 years ago

This seems to be related to strict mode, not to being "external".

xperseguers commented 4 years ago

I tried to configure my local MySQL server in strict mode but it does not seem to cause a problem. Could you please test again with current master and report?

ThePinkOne commented 4 years ago

Everything works perfectly fine in the current master. So I'll close this issue :-)