Page MenuHomePhabricator

Crash on LDAPAuthentication2 after getting the results of ldap_search
Open, Needs TriagePublicBUG REPORT

Description

I am trying to authenticate (with account autocreation) to a windows AD server, after some issues I found the way to get through the different errors and prepare the current configuration (see attached)

Steps to Reproduce:
Log with a valid windows domain user.

Actual Results:

Notice: Undefined index: uid in /var/www/mediawiki/extensions/LDAPAuthentication2/src/PluggableAuth.php on line 76

Notice: Undefined index: cn in /var/www/mediawiki/extensions/LDAPAuthentication2/src/PluggableAuth.php on line 77

[0d1e1f44929a8dde9b242c11] /index.php?title=Especial:PluggableAuthLogin MWException from line 66 of /var/www/mediawiki/extensions/LDAPProvider/src/DomainConfigFactory.php: No section 'authorization' found in configuration for domain 'LDAP'!

Backtrace:

#0 /var/www/mediawiki/extensions/LDAPAuthorization/src/Hook/PluggableAuthUserAuthorization.php(59): MediaWiki\Extension\LDAPProvider\DomainConfigFactory->factory(string, string)
#1 /var/www/mediawiki/extensions/LDAPAuthorization/src/Hook/PluggableAuthUserAuthorization.php(70): MediaWiki\Extension\LDAPAuthorization\Hook\PluggableAuthUserAuthorization->__construct(User, boolean)
#2 /var/www/mediawiki/includes/Hooks.php(174): MediaWiki\Extension\LDAPAuthorization\Hook\PluggableAuthUserAuthorization::callback(User, boolean)
#3 /var/www/mediawiki/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#4 /var/www/mediawiki/extensions/PluggableAuth/includes/PluggableAuthLogin.php(47): Hooks::run(string, array)
#5 /var/www/mediawiki/includes/specialpage/SpecialPage.php(569): PluggableAuthLogin->execute(NULL)
#6 /var/www/mediawiki/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#7 /var/www/mediawiki/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#8 /var/www/mediawiki/includes/MediaWiki.php(865): MediaWiki->performRequest()
#9 /var/www/mediawiki/includes/MediaWiki.php(515): MediaWiki->main()
#10 /var/www/mediawiki/index.php(42): MediaWiki->run()
#11 {main}

Expected Results:
Either a proper login with the account being created, or a warning with the cause of the error.

Event Timeline

@Aseques: Please provide exact MediaWiki version information and exact version information of the involved extension(s). Thanks!

Sorry, forgot to attach it:

MediaWiki 1.33.0
LDAPAuthentication2 1.0.0 (60952c4) 13:22, 8 juny 2019
LDAPAuthorization 1.0.0 (0eb9ef4) 14:07, 6 feb 2019
LDAPProvider 1.0.0 (344c6c8) 23:40, 7 març 2019
PluggableAuth 5.7 (a69f626) 05:03, 7 feb 2019

The crash is caused by missing authorization configuration in the ldap config block (I tried to document it in the wiki), unfortunately, after creating a block config with the authorization section there are the undefined index errors for both the uid and the cn, so the issue is sitll present.