Try and errors
When I try to authenticate as
an LDAP User , I got this error : [ec6935bb5d6a9b7d0d944cdd] 2022-08-05 13:21:20: Erreur fatale de type « MWException »
a Local User : I got this error : Could not authenticate
All the /LDAPProvider/maintenance/ scripts works fine ie : CheckConnection.php CheckLogin.php ConvertLdapAuthenticationConfig.php ShowUserGroups.php ShowUserInfo.php
Versions
MediaWiki 1.35.4
PHP 7.4.30 (apache2handler)
MariaDB 10.5.15-MariaDB-0+deb11u1
ICU 67.1
LDAPAuthentication 2 1.0.3 (6bc5848) 22 juillet 2022 à 10:15
LDAPAuthorization 1.1.0 (a0d1a5b) 4 juillet 2022 à 07:18
LDAPProvider 1.0.5 (80f8cc8) 22 juillet 2022 à 11:29
PluggableAuth 5.7 (a932c78) 23 mai 2022 à 21:17
Configs
{
"example.com": {
"connection": {
"server": "ad.example.com",
"port": "636",
"enctype": "ssl",
"user": "cn=ldap-connect,cn=Users,dc=example,dc=com",
"pass": "********",
"options": {
"LDAP_OPT_DEREF": 1
},
"basedn": "cn=Users,dc=example,dc=com",
"groupbasedn": "cn=Users,dc=example,dc=com",
"userbasedn": "cn=Users,dc=example,dc=com",
"searchattribute": "sAMAccountName",
"searchstring": "cn=USER-NAME,cn=Users,dc=example,dc=com",
"usernameattribute": "sAMAccountName",
"realnameattribute": "displayName",
"emailattribute": "mail",
"grouprequest": "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\UserMemberOf::factory"
},
"authorization": {
"rules": {
"groups": {
"required": [ "CN=wikiaaa,CN=Users,dc=example,dc=com" ]
}
}
}
}
}
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
$wgSitename = "Wiki aaa";
$wgScriptPath = "";
$wgScriptExtension = ".php";
$wgServer = "https://wikiaaa.example.com";
$wgStylePath = "$wgScriptPath/skins";
$wgLogo = "$wgStylePath/common/images/logo_aaa.png";
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['user']['createaccount'] = true;
$wgGroupPermissions['wikiaaa']['createaccount'] = true;
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['sysop']['edit'] = true;
$wgGroupPermissions['user']['edit'] = true;
$wgGroupPermissions['aaa']['edit'] = true;
$wgEnableEmail = false;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "apache@wikiaaa.example.com";
$wgPasswordSender = "apache@wikiaaa.example.com";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "wikiaaa";
$wgDBuser = "userwikiaaa";
$wgDBpassword = "**********";
$wgDBprefix = "";
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";
$wgDBmysql5 = false;
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgFileExtensions = array('png', 'gif', 'jpg', 'jpeg', 'pdf', 'dmg', 'ppd', 'zip', 'doc', 'docx');
$wgUseInstantCommons = false;
$wgShellLocale = "fr_FR.utf8";
$wgLanguageCode = "fr";
$wgSecretKey = "6gyo8sj9a2d20vsdh7t51r080s0kqk5tdlx08zxolbxrtui8e7frd0hkxv7xoki825n756";
$wgUpgradeKey = "jbkvvpd7nr";
$wgDefaultSkin = "vector";
wfLoadSkin( 'Vector' );
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
$wgDiff3 = "/usr/bin/diff3";
if (is_file("/etc/mediawiki-extensions/extensions.php")) {
include("/etc/mediawiki-extensions/extensions.php");
}
$wgResourceLoaderMaxQueryLength = -1;
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'AccessControl' );
wfLoadExtension( 'Math' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'LabeledSectionTransclusion' );
wfLoadExtension( 'LDAPAuthorization' );
wfLoadExtension( 'LDAPAuthentication2' );
wfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'LDAPProvider' );
$LDAPAuthentication2AllowLocalLogin = true;
$LDAPAuthentication2UsernameNormalizer = true;
$LDAPProviderDomainConfigs = "/etc/mediawiki/ldapprovider-aaa.json";
$wgDebugLogGroups['PluggableAuth'] = "/var/log/mediawiki/debug-{$wgDBname}.log";
$wgDebugLogGroups['MediaWiki\\Extension\\LDAPProvider\\Client'] = "/var/log/mediawiki/debug-{$wgDBname}.log";
$wgDebugLogGroups['LDAPAuthentication2'] = "/var/log/mediawiki/debug-{$wgDBname}.log";
$wgDebugLogGroups['LDAPAuthorization'] = "/var/log/mediawiki/debug-{$wgDBname}.log";
$wgDebugLogGroups['LDAPProvider'] = "/var/log/mediawiki/debug-{$wgDBname}.log";
wfLoadExtension( 'Cite' );
wfLoadExtension( 'Mpdf' );
$wgMpdfTab = true;
$wgMpdfToolboxLink = true;
Logs
#Local user
2022-08-05 13:43:13 wikiaaa.example.com wikiaaa: In execute()
2022-08-05 13:43:13 wikiaaa.example.com wikiaaa: Getting PluggableAuth singleton
2022-08-05 13:43:13 wikiaaa.example.com wikiaaa: Class name: MediaWiki\Extension\LDAPAuthentication2\PluggableAuth
2022-08-05 13:43:13 wikiaaa.example.com wikiaaa: Authentication failure.
2022-08-05 13:43:13 wikiaaa.example.com wikiaaa: ERROR: Could not authenticate
# LDAP user
2022-08-05 13:45:34 wikiaaa.example.com wikiaaa: In execute()
2022-08-05 13:45:34 wikiaaa.example.com wikiaaa: Getting PluggableAuth singleton
2022-08-05 13:45:34 wikiaaa.example.com wikiaaa: Class name: MediaWiki\Extension\LDAPAuthentication2\PluggableAuth
2022-08-05 13:45:35 wikiaaa.example.com wikiaaa: Setting LDAP_OPT_PROTOCOL_VERSION to 3
2022-08-05 13:45:35 wikiaaa.example.com wikiaaa: Setting LDAP_OPT_REFERRALS to 0
2022-08-05 13:45:35 wikiaaa.example.com wikiaaa: Setting LDAP_OPT_DEREF to 1
2022-08-05 13:45:35 wikiaaa.example.com wikiaaa: MediaWiki\Extension\LDAPProvider\Client::getSearchString: User DN is: 'cn=user1,cn=Users,dc=example,dc=com'
2022-08-05 13:45:35 wikiaaa.example.com wikiaaa: Ran LDAP search for '(sAMAccountName=user1)' in 0,0016958713531494 seconds.