Hi,
I am new to mediawiki, and I am trying to use account from a LDAP server to enter my wiki. However, whenever I try a connection the site give me this :
There seems to be a problem with your login session; this action has been canceled as a precaution against session hijacking. Please resubmit the form.
This is the added settings on my LocalSettings.php, I have censore the sensible information with * :
$wgDebugDumpSql = true;
$wgShowExceptionDetails = true;
$wgShowSQLErrors = true;
$wgShowDBErrorBacktrace = true;
$wgDebugLogGroups['PluggableAuth'] =
$wgDebugLogGroups['LDAP'] =
$wgDebugLogGroups['mediawiki\\Extension\\LDAPProvider\\Client'] =
$wgDebugLogGroups['LDAPGroups'] =
$wgDebugLogGroups['LDAPUserInfo'] =
$wgDebugLogGroups['LDAPAuthentication2'] =
$wgDebugLogGroups['LDAPAuthorization'] = '/tmp/LDAP.log';
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['Reader']['createaccount'] = false;
$wgGroupPermissions['Reader']['read'] = true;
$wgGroupPermissions['Reader']['edit'] = false;
$wgGroupPermissions['Writer']['createaccount'] = false;
$wgGroupPermissions['Writer']['read'] = true;
$wgGroupPermissions['Writer']['edit'] = true;
wfLoadExtensions( [
'PluggableAuth',
'Auth_remoteuser',
'LDAPProvider',
'LDAPAuthentication2',
'LDAPAuthorization',
'LDAPUserInfo'
] );
#$wgSessionCacheType = 'session-cache';
#$wgObjectCaches['session-cache'] = [ 'factory' => 'ObjectCache::newAnything', 'keyspace' => 'shared-session' ];
$LDAPAuthorizationAutoAuthRemoteUserStringParser = 'domain-backslash-username';
$LDAPAuthentication2UsernameNormalizer = 'strtolower';
$LDAPAuthentication2AllowLocalLogin = true;
$wgAuthRemoteuserAllowUserSwitch = true;
#$wgPluggableAuth_EnableLocalLogin = true;
#$LDAPProviderDomainConfigs = "$IP/extensions/LDAPProvider/docs/ldapprovider.json";
$wgAuthRemoteuserUserName = function() {
$user = '';
if( isset( $_SERVER[ 'REMOTE_USER' ] ) ) {
$user = strtolower( $_SERVER[ 'REMOTE_USER' ] );
}
return $user;
};
$LDAPProviderDomainConfigProvider = function() {
$config = [
'nrcanLDAP' => [
'connection' => [
"server" => "*****************",
"options" => [
"LDAP_OPT_DEREF" => 1
],
"basedn" => "dc=**,dc=**,dc=**,dc=**",
"groupbasedn" => "dc=**,dc=**,dc=**,dc=**",
"userbasedn" => "dc=**,dc=**,dc=**,dc=**",
"searchattribute" => "***",
#"usernameattribute" => "uid",
#"realnameattribute" => "fullname",
#"emailattribute" => "mail",
"grouprequest" => "mediawiki\\Extension\\LDAPProvider\\src\\UserGroupsRequest\\GroupMember::factory"
],
'authorization' => [
'rules' => [
'groups' => [
'required' => [
'dc=**,dc=**,dc=**,dc=**'
]
]
]
],
'userinfo' => [
'attributes-map' => [
'email' => 'mail',
'realname' => 'fullname'
]
]
]
];
return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );
};