Topic on Extension talk:LDAPProvider/Flow

LDAPNoDomainConfigException

4
JonathanKing~mediawikiwiki (talkcontribs)

I have the following config file


wfLoadExtensions( [

        'PluggableAuth',

        'LDAPProvider',

        'LDAPAuthentication2',

        'LDAPAuthorization',

        'LDAPUserInfo'

] );

$LDAPProviderCacheTime = 1;

$LDAPAuthorizationAutoAuthRemoteUserStringParser = 'username-at-domain';

$LDAPAuthentication2UsernameNormalizer = 'strtolower';

$LDAPAuthentication2AllowLocalLogin = false;

$wgPluggableAuth_EnableAutoLogin = false;

$wgPluggableAuth_EnableLocalLogin = false;

$wgPluggableAuth_EnableLocalProperties = true;

$wgPluggableAuth_ButtonLabel = "Log in";

$LDAPProviderDomainConfigProvider = function() {

        $config = [

                ‘myschool.edu' => [

                        'connection' => [

                                "server"            => "dc01.myschool.edu dc02.myschool.edu",

                                "options"           => [

                                        "LDAP_OPT_DEREF" => 1

                                ],

                                "port"              => 389,

                                "enctype"           => "clear",

                                "user"              => “myschool\wikilookupaccount",

                                "pass"              => “supersecret",

                                "basedn"            => "dc=myschool,dc=edu",

                                "groupbasedn"       => "dc=myschool,dc=edu",

                                "userbasedn"        => "dc=myschool,dc=edu",

                                "searchattribute"   => "samaccountname",

                                "searchstring"      => "myschool\\USER-NAME",

                                "usernameattribute" => "samaccountname",

                                "realnameattribute" => "displayname",

                                "emailattribute"    => "mail",

                                "grouprequest"      => "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\GroupMember::factory"

                        ],

                        'authorization' => [

                                'rules' => [

                                        'groups' => [

                                                'required' => [

                                                        "cn=global techwiki,ou=groups-internal,ou=rcspeople,dc=myschool,dc=edu"

                                                ]

                                        ]

                                ]

                        ]

                ]

        ];

        return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );

};


and my test account is definitely in the required group, but I get the following error when I login. Note that after I get this error, I am in fact logged in and can browse the site as expected. Also note the capital letter in Myschool below, which I have only ever entered lower case in the config above. If I change the $config line to "myschool" from "myschool.edu" I get other errors. Not sure what is happening here.


[31fd0d9e14a58f830cea583f] /wiki/Special:UserLogin MediaWiki\Extension\LDAPProvider\LDAPNoDomainConfigException from line 61 of /var/www/techwiki/w/extensions/LDAPProvider/src/DomainConfigFactory.php: No configuration available for domain 'Myschool'!

Backtrace:

#0 /var/www/techwiki/w/extensions/LDAPProvider/src/ClientFactory.php(55): MediaWiki\Extension\LDAPProvider\DomainConfigFactory->factory(string, string)

#1 /var/www/techwiki/w/extensions/LDAPProvider/src/Hook/UserLoggedIn.php(138): MediaWiki\Extension\LDAPProvider\ClientFactory->getForDomain(string)

#2 /var/www/techwiki/w/extensions/LDAPProvider/src/Hook/UserLoggedIn.php(89): MediaWiki\Extension\LDAPProvider\Hook\UserLoggedIn->createLdapClientForDomain()

#3 /var/www/techwiki/w/extensions/LDAPProvider/src/Hook/UserLoggedIn.php(78): MediaWiki\Extension\LDAPProvider\Hook\UserLoggedIn->process()

#4 /var/www/techwiki/w/includes/Hooks.php(174): MediaWiki\Extension\LDAPProvider\Hook\UserLoggedIn::callback(User)

#5 /var/www/techwiki/w/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)

#6 /var/www/techwiki/w/includes/auth/AuthManager.php(2407): Hooks::run(string, array)

#7 /var/www/techwiki/w/includes/auth/AuthManager.php(693): MediaWiki\Auth\AuthManager->setSessionDataForUser(User, boolean)

#8 /var/www/techwiki/w/includes/specialpage/AuthManagerSpecialPage.php(355): MediaWiki\Auth\AuthManager->continueAuthentication(array)

#9 /var/www/techwiki/w/includes/specialpage/AuthManagerSpecialPage.php(482): AuthManagerSpecialPage->performAuthenticationStep(string, array)

#10 /var/www/techwiki/w/includes/htmlform/HTMLForm.php(660): AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)

#11 /var/www/techwiki/w/includes/specialpage/AuthManagerSpecialPage.php(416): HTMLForm->trySubmit()

#12 /var/www/techwiki/w/includes/specialpage/LoginSignupSpecialPage.php(313): AuthManagerSpecialPage->trySubmit()

#13 /var/www/techwiki/w/includes/specialpage/SpecialPage.php(569): LoginSignupSpecialPage->execute(NULL)

#14 /var/www/techwiki/w/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)

#15 /var/www/techwiki/w/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)

#16 /var/www/techwiki/w/includes/MediaWiki.php(865): MediaWiki->performRequest()

#17 /var/www/techwiki/w/includes/MediaWiki.php(515): MediaWiki->main()

#18 /var/www/techwiki/w/index.php(42): MediaWiki->run()

#19 {main}

Osnard (talkcontribs)

It says "No configuration available for domain 'Myschool'!" but in you domain condif you have specified "myschool.edu". Please use 'Myschool' as the main key of the domain config variable.

JonathanKing~mediawikiwiki (talkcontribs)

When I changed to Myschool, things started working again. Thanks for you help! I was certain I tried that before, but oh well, works now.

Osnard (talkcontribs)

Glad to hear :)

Reply to "LDAPNoDomainConfigException"