Topic on Project:Support desk

Cannot configure ldap on version 1.42.3

4
Techietubby (talkcontribs)

I am running Rocky Linux release 9.4 and have installed the following extensions:

cd /var/www/html/mediawiki/extensions

git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/LDAPAuthentication2

git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/LDAPProvider

git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/LDAPAuthorization

git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Auth_remoteuser

Added the following code at the bottom of the LocalSettings.php file:

wfLoadExtensions( [

        'PluggableAuth',

        'Auth_remoteuser',

        'LDAPProvider',

        'LDAPAuthentication2',

        'LDAPAuthorization',

        'LDAPUserInfo'

] );

created ../ldapprovider.json

{

        "LDAP": {

                "connection": {

                        "server": "auth1.b.com",

                        "port": "636",

                        "enctype": "ssl",

                        "user": "cn=read-only-admin,dc=b,dc=com",

                        "pass": "KvNCxxxx94QIiyZ",

                        "options": {

                                "LDAP_OPT_DEREF": 1

                        },

                        "basedn": "dc=b,dc=com",

                        "groupbasedn": "ou=group,dc=b,dc=com",

                        "userbasedn": "ou=people,dc=b,dc=com",

                        "searchattribute": "uid",

                        "searchstring": "uid=USER-NAME,ou=people,dc=b,dc=com",

                        "usernameattribute": "uid",

                        "realnameattribute": "cn",

                        "emailattribute": "mail"

                }

        }

}

I can login locally but LDAP doesn't work. I can login from the OS level e.g. su - ldapuser1 on this machine so I know there is an active connection.

Techietubby (talkcontribs)

If I run the maintenance scripts I get an error e.g.

php maintenance/run.php ./extensions/LDAPProvider/maintenance/ShowUserGroups.php --conf /var/www/html/mediawiki

PHP Fatal error:  Uncaught MediaWiki\Settings\SettingsBuilderException: None of the built-in formats are suitable for '/var/www/html/mediawiki' in /var/www/html/mediawiki/includes/Settings/Source/FileSource.php:125

Stack trace:

#0 /var/www/html/mediawiki/includes/Settings/SettingsBuilder.php(472): MediaWiki\Settings\Source\FileSource->load()

#1 /var/www/html/mediawiki/includes/Settings/SettingsBuilder.php(442): MediaWiki\Settings\SettingsBuilder->loadRecursive()

#2 /var/www/html/mediawiki/includes/Setup.php(223): MediaWiki\Settings\SettingsBuilder->apply()

#3 /var/www/html/mediawiki/maintenance/run.php(49): require_once('...')

#4 {main}

 thrown in /var/www/html/mediawiki/includes/Settings/Source/FileSource.php on line 125

Osnard (talkcontribs)

Most likely some incompatibility with MediaWiki 1.42. The LDAP extensions are mainly developed against the LTS branch which currently is 1.39.

Are there any additional configs? Like for $LDAPProviderDomainConfigs or $LDAPProviderDomainConfigProvider?

Maybe try using a PHP inline config with $LDAPProviderDomainConfigProvider as shown here: Extension:LDAPProvider#Dynamic_PHP_array

Techietubby (talkcontribs)

I used $LDAPProviderDomainConfigs = "$IP/../ldapprovider.json"; and created this file as per the example. I also tried with the LDAPProviderDomainConfigProvider but neither works.

I think I will try to rebuild using 1.39

Reply to "Cannot configure ldap on version 1.42.3"