Hello,
I'm not sure this is the correct place to post this, but based on the error, it seems to be the most appropriate, if I'm wrong please point me to the right place and I shall post my question there.
MediaWiki: 1.34.0
PHP: 7.3.22
MariaDB: 10.3.17
LDAPProvider: 1.0.5
PluggableAuth: 5.7
LDAPAuthentication2: 1.0.1
I'm implementing a local Wiki for my company and I'm having troubles with the LDAP configuration, the following error appears when debugging is enabled:
Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/mediawiki/extensions/LDAPProvider/src/DomainConfigProvider/LocalJSONFile.php on line 53
[X2kKJjbSu3qH1fIln5ofhQAAABg] /index.php?title=Especial:Vers%C3%A3o MWException from line 54 of /var/www/mediawiki/extensions/LDAPProvider/src/DomainConfigProvider/LocalJSONFile.php: Could not parse configuration file '/var/www/mediawiki/ldap.json'!
Backtrace:
#0 /var/www/mediawiki/extensions/LDAPProvider/src/DomainConfigProvider/LocalJSONFile.php(73): MediaWiki\Extension\LDAPProvider\DomainConfigProvider\LocalJSONFile->__construct(string)
#1 [internal function]: MediaWiki\Extension\LDAPProvider\DomainConfigProvider\LocalJSONFile::newInstance(MediaWiki\Extension\LDAPProvider\Config)
#2 /var/www/mediawiki/extensions/LDAPProvider/src/DomainConfigFactory.php(106): call_user_func_array(string, array)
#3 /var/www/mediawiki/extensions/LDAPAuthentication2/src/Setup.php(12): MediaWiki\Extension\LDAPProvider\DomainConfigFactory::getInstance()
#4 /var/www/mediawiki/includes/Setup.php(906): MediaWiki\Extension\LDAPAuthentication2\Setup::init()
#5 /var/www/mediawiki/includes/WebStart.php(81): require_once(string)
#6 /var/www/mediawiki/index.php(41): require(string)
#7 {main}
My ldap.json
is as follows:
{
"LDAP": {
"connection": {
"server": "REDACTED.local",
"port": "389",
"enctype": "clear",
"user": "REDACTED@REDACTED.local",
"pass": "REDACTED",
"options": {
"LDAP_OPT_DEREF": 1
},
"basedn": "dc=REDACTED,dc=local",
"userbasedn": "OU=Users,OU=REDACTED,DC=REDACTED,DC=local",
"searchattribute": "sAMAccountName",
"searchstring": "sAMAccountName=USER-NAME,dc=REDACTED,dc=local",
"usernameattribute": "sAMAccountName",
"realnameattribute": "displayName",
"emailattribute": "mail"
},
"userinfo": {
"attributes-map": {
"email": "mail",
"realname": "displayName",
"nickname": "givenName"
}
}
}
}
The "user" in the "connection" part of the JSON file was set to sAMAccountName=REDACTED,dc=REDACTED,dc=local
but to no avail, as I keep getting the same error. Could someone point me in the right direction, please? Any help will be much appreciated :)