Page MenuHomePhabricator

LDAP login does not work when local login is enabled
Closed, ResolvedPublic

Description

I have such specific configuration for PluggableAuth:

$wgPluggableAuth_EnableLocalLogin = true;

When I try to login using "LDAP1" or "LDAP2" domain, I receive following error:

Incorrect username or password entered. Please try again.

I did some debugging and found out that problem is here.
Necessary authentication request could not be found, because array_filter(..) preserves array keys, so in my case request was in $matches[1] (instead of $matches[0]).

Probably resetting array indexes will be a solution.

My LocalSettings.php:

wfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'LDAPProvider' );
wfLoadExtension( 'LDAPAuthentication2' );
wfLoadExtension( 'LDAPAuthorization' );
wfLoadExtension( 'LDAPUserInfo' );
wfLoadExtension( 'LDAPGroups' );
wfLoadExtension( 'LDAPSyncAll' );


$LDAPProviderDomainConfigs = "$IP/extensions/LDAPProvider/docs/ldapprovider.json";

$wgPluggableAuth_Config['Log In (LDAP 1)'] = [
	'plugin' => 'LDAPAuthentication2',
	'data' => [
		'domain' => 'LDAP1'
	]
];

$wgPluggableAuth_Config['Log In (LDAP 2)'] = [
	'plugin' => 'LDAPAuthentication2',
	'data' => [
		'domain' => 'LDAP2'
	]
];

$wgPluggableAuth_EnableLocalLogin = true;

$LDAPAuthentication2AllowLocalLogin = true;

Event Timeline

Change 903834 had a related patch set uploaded (by Aklapper; author: AKulbii):

[mediawiki/extensions/PluggableAuth@master] Fix issue with LDAP login when local login is enabled

https://gerrit.wikimedia.org/r/903834

Thank you very much for the bug report and the fix. I will work on getting this reviewed and merged soon.

Change 903834 merged by jenkins-bot:

[mediawiki/extensions/PluggableAuth@master] Fix issue with LDAP login when local login is enabled

https://gerrit.wikimedia.org/r/903834

Change 926697 had a related patch set uploaded (by Cicalese; author: AKulbii):

[mediawiki/extensions/PluggableAuth@REL1_39] Fix issue with LDAP login when local login is enabled

https://gerrit.wikimedia.org/r/926697

Change 926698 had a related patch set uploaded (by Cicalese; author: AKulbii):

[mediawiki/extensions/PluggableAuth@REL1_40] Fix issue with LDAP login when local login is enabled

https://gerrit.wikimedia.org/r/926698

Change 926697 merged by jenkins-bot:

[mediawiki/extensions/PluggableAuth@REL1_39] Fix issue with LDAP login when local login is enabled

https://gerrit.wikimedia.org/r/926697

Change 926698 merged by jenkins-bot:

[mediawiki/extensions/PluggableAuth@REL1_40] Fix issue with LDAP login when local login is enabled

https://gerrit.wikimedia.org/r/926698