Topic on Extension talk:LDAPAuthentication2

Fatal exception of type MWException when activating LDAPAuthentication2

6
AID-PMBD (talkcontribs)

Hello,


I'm having trouble trying to connect my Mediawiki Installation to an LDAP Server. I'm using the extensions Pluggable Auth, LDAPProvider and LDAPAuthentication2.


My Installation:

Ubuntu 18.04

Mediawiki 1.31.6

PHP 7.2.24-0ubuntu0.18.04.7 (apache2handler)

MySQL 5.7.32-0ubuntu0.18.04.1


Extensions:

PluggableAuth 5.4 (300ac44) 05:28, 14. Apr. 2018

LDAPProvider 1.0.5 (098cd58) 14:33, 1. Sep. 2020

LDAP Authentication for Mediawiki 1.31


Content of my ldap.json file:


{

       "LDAP": {

               "connection": {

                       "server": "server-ldap.local",

                       "port": "389"

                       "user": "CN=Mediawiki-auth,OU=people,DC=server-ldap,DC=loc$

                       "pass": "password",

                       "enctype": "tls",

                       "options": {

                               "LDAP_OPT_DEREF": 1

                       },

                       "basedn": "dc=server-ldap,dc=local",

                       "groupbasedn": "dc=server-ldap,dc=local",

                       "userbasedn": "dc=server-ldap,dc=local",

                       "searchattribute": "uid",

                       "searchstring": "uid=USER-NAME,dc=server-ldap,dc=local",

                       "usernameattribute": "uid",

                       "realnameattribute": "cn",

                       "emailattribute": "mail"

               }

       }

}


Whenever I'm enabling the LDAPAuthentication2 extension in my LocalSettings.php through wfLoadExtension( 'LDAPAuthentication2' ); I get the error "[7b001ef83ac85982732e6fad] 2021-01-03 15:12:39: Fatal exception of type MWException" when trying to access my wiki.


Can anyone offer advice?


Thank you

AID-PMBD (talkcontribs)

My logfile returns:

[exception] [2244535a0f53ec76a495bf27] /xxxx/index.php/Spezial:Version   MWException from line 42 of /var/www/html/xxxx/extensions/LDAPProvider/src/DomainConfi$

Auf die Konfigurationsdatei „/etc/mediawiki/ldapprovider.json“ konnte nicht zugegriffen werden!

AID-PMBD (talkcontribs)

So I set up the domainconfig in LocalSettings.php through $LDAPProviderDomainConfigProvider = "var/www/ldap.json/ldap.json";

pointing to my ldap.json file.


The error now says: [exception] [470280d9192d6b1dc7874308] /xxxx/index.php/Spezial:Version   Error from line 49 of /var/www/html/xxxx/extensions/LDAPProvider/src/DomainConfigFactory.php: Call to a member function getConfigArray() on null

AID-PMBD (talkcontribs)

Full error message:

[ac67fda33191723225f91cbc] /xxxx/index.php?title=Spezial:Anmelden&returnto=Hauptseite Error from line 49 of /var/www/html/xxxx/extensions/LDAPProvider/src/DomainConfigFactory.php: Call to a member function getConfigArray() on null

Backtrace:

#0 /var/www/html/xxxx/extensions/LDAPProvider/src/DomainConfigFactory.php(109): MediaWiki\Extension\LDAPProvider\DomainConfigFactory->__construct(NULL)

#1 /var/www/html/xxxx/extensions/LDAPAuthentication2/src/Setup.php(14): MediaWiki\Extension\LDAPProvider\DomainConfigFactory::getInstance()

#2 /var/www/html/xxxx/includes/Setup.php(948): MediaWiki\Extension\LDAPAuthentication2\Setup::init()

#3 /var/www/html/xxxx/includes/WebStart.php(88): require_once(string)

#4 /var/www/html/xxxx/index.php(39): require(string)

#5 {main}

Osnard (talkcontribs)
AID-PMBD (talkcontribs)

Thank you so much Osnard. It worked! I decided to go for the php array in general as configuration method instead of the ldap.json file, because it seems less fuss. The I had to install php-ldap and restart Apache2, now it works. Again thank you so much.

Reply to "Fatal exception of type MWException when activating LDAPAuthentication2"