Every time I add the authorization section to the ldap.json file, I get the following errors when I run the maintenance/update.php code.
Found invalid JSON in file: /var/www/html/wiki/ldap.json
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/wiki/extensions/LDAPProvider/src/DomainConfigProvider/LocalJSONFile.php on line 53
[436fc5157dc2c6d4b9499735] [no req] MWException from line 54 of /var/www/html/wiki/extensions/LDAPProvider/src/DomainConfigProvider/LocalJSONFile.php: Could not parse configuration file '/var/www/html/wiki/ldap.json'!
Backtrace:
#0 /var/www/html/wiki/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/html/wiki/extensions/LDAPProvider/src/DomainConfigFactory.php(106): call_user_func_array(string, array)
#3 /var/www/html/wiki/extensions/LDAPAuthentication2/src/Setup.php(12): MediaWiki\Extension\LDAPProvider\DomainConfigFactory::getInstance()
#4 /var/www/html/wiki/includes/Setup.php(906): MediaWiki\Extension\LDAPAuthentication2\Setup::init()
#5 /var/www/html/wiki/maintenance/doMaintenance.php(83): require_once(string)
#6 /var/www/html/wiki/maintenance/update.php(277): require_once(string)
#7 {main}
This is my ldap.json code. I'm able to connect and authenticate without the authorization config set.
{
"itorg.ad.buffalo.edu": {
"connection": {
"server": "itorg.ad.buffalo.edu",
"port": "636",
"user": "CN=#######,OU=Users,OU=UBSA,OU=StudentAssociation,OU=ITORGS,DC=itorg,DC=ad,DC=buffalo,DC=edu",
"pass": "#######",
"enctype": "ssl",
"options": {
"LDAP_OPT_DEREF": 1
},
"basedn": "DC=itorg,DC=ad,DC=buffalo,DC=edu",
"userbasedn": "DC=itorg,DC=ad,DC=buffalo,DC=edu",
"groupbasedn": "DC=itorg,DC=ad,DC=buffalo,DC=edu",
"searchattribute": "samaccountname",
"usernameattribute": "samaccountname",
"realnameattribute": "cn",
"emailattribute": "mail",
"grouprequest": "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\UserMemberOf::factory",
"presearchusernamemodifiers": [ "spacestounderscores", "lowercase" ]
},
"userinfo": [],
"authorization" =>[
"rules" =>[
"groups" =>[
"required" => [ "CN=UBSA_Student_Staff,OU=Groups,OU=UBSA,OU=StudentAssociation,OU=ITORGS,DC=itorg,DC=ad,DC=buffalo,DC=edu" ]
]
]
],
"groupsync": {
"mapping": {
"sysop": "CN=UBSA_Pro_Staff,DC=itorg,DC=ad,DC=buffalo,DC=edu"
}
}
}
}
I'd REALLY appreciate any help out there... I have read through the other similar issues below, but I believe I have already implemented the suggestions that helped people out already. I've been knocking my head against the wall on this one for a couple weeks now.