shanept / mediawiki-LdapAuth

New LdapAuthentication provider plugin for mediawiki
GNU General Public License v3.0
4 stars 5 forks source link

$wgLdapAuthUsernameField error #16

Open tmhoskins opened 5 years ago

tmhoskins commented 5 years ago

It looks like a bug in the code is somehow getting only the first character of the default value of $wgLdapAuthUsernameField (which is "sAMAccountName") and returning that.

My LocalSettings.php are:

LdapAuth config

wfLoadExtension( 'LdapAuth' );

$wgLdapAuthDomainNames = [

'SNRT'

];

$wgLdapAuthServers = [

'SNRT' => ['172.16.1.XXX']

];

$wgLdapAuthBindDN = [

'SNRT' => 'CN=ldap_lookup,CN=Users,DC=snrt,DC=io'

];

$wgLdapAuthBindPass = [

'SNRT' => 'BindPass'

];

$wgLdapAuthBaseDN = [

'SNRT' => 'OU=SNRT,DC=snrt,DC=io'

];

//$wgLdapAuthSearchFilter = [

//'SNRT' => '(&(objectClass=SNRT)(displayName=%1$s))'

//];

$wgLdapAuthEncryptionType = [

'SNRT' => 'tls'

];

$wgLdapAuthRequireDomain = false;

$wgLdapAuthIsActiveDirectory = true;

//$wgLdapAuthUseLocal = true;

Enable Scure Login

$wgSecureLogin = true;

When I try to login using the LdapAuth extension I get the error:

Could not complete search with dn "OU=SNRT,DC=snrt,DC=io", query "(" and filters "s,givenName,sn,displayName,mail". LDAP error was [-7] Bad search filter

Obviously the web-server is trying to communicate with the AD server but the code has errors. This has been the issue all along, the code that the extension lists as configuration settings was misleading. You can't just set a string value in most of the settings, they have to be arrays or you get a php error.