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 64 forks source link

Fix exception on backend login due to missing initialization of ldapTlsReqcert #89

Closed gedoens closed 3 years ago

gedoens commented 4 years ago

I just tried to update this extension on my installation from 3.3.1 to 3.5.1. Afterwards, I received the following error when trying to log in to the backend, even as a non-ldap user (admin):

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Return value of Causal\IgLdapSsoAuth\Domain\Model\Configuration::isLdapTlsReqcert() must be of the type bool, null returned | TypeError thrown in file /var/www/typo3/typo3conf/ext/ig_ldap_sso_auth/Classes/Domain/Model/Configuration.php in line 316. Requested URL: http://example.com/typo3/?loginProvider=1433416747

I managed to fix the bug for myself at least, but I'm not entirely sure on the specifics. It seems the initial value for the $ldapTlsReqcert field (true) is ignored, hence it needs to be set explicitly. Which is what I then did in thawProperties(). Since the initialization with true seems to be ignored, I removed it as well. Apparently you guys don't all have this bug so maybe it is something specific to my PHP version.

I'm using TYPO3 v8.7.31 and PHP v7.3.14 (Debian).

jrdeck commented 4 years ago

I tried the patch, but was having issues. In the end, a db update worked for me.

From:

MariaDB [typo3]> select * from tx_igldapssoauth_config\G
*************************** 1. row ***************************
               uid: 1
               pid: 0
            tstamp: 1581991569
            crdate: 1571017589
         cruser_id: 1
           deleted: 0
            hidden: 0
           sorting: 256
              name: LDAP Server
           domains:
       ldap_server: 0
      ldap_charset: utf-8
         ldap_host: ldaps://some.ldap-server.com
         ldap_port: 636
          ldap_tls: 0
          ldap_ssl: 0

To:

MariaDB [typo3]> select * from tx_igldapssoauth_config\G
*************************** 1. row ***************************
               uid: 1
               pid: 0
            tstamp: 1581991569
            crdate: 1571017589
         cruser_id: 1
           deleted: 0
            hidden: 0
           sorting: 256
              name: LDAP Server
           domains:
       ldap_server: 0
      ldap_charset: utf-8
         ldap_host: some.ldap-server.com
         ldap_port: 636
          ldap_tls: 0
          ldap_ssl: 1

ie:

update tx_igldapssoauth_config set ldap_host = 'some.ldap-server.com', ldap_ssl=1;

gedoens commented 4 years ago

@jrdeck Yes, this patch is not intended to fix the issue that you were having (ldap[s]:// prefix). I solved that one with a DB update as well.