MediaWiki Active directory authentication
Download Extension
https://github.com/wikimedia/mediawiki-extensions-LdapAuthentication/tree/REL1_26
And install it on /var/www/html/mediawiki/extensions folder
Create table on database
With the plugin, there is a table that we add.
root@support:/var/www/html/mediawiki/extensions/LdapAuthentication/schema# cat ldap-mysql.sql CREATE TABLE /*_*/ldap_domains ( -- IF for domain domain_id int not null primary key auto_increment, -- domain itself domain varchar(255) binary not null, -- User to which this domain belongs user_id int not null ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/user_id on /*_*/ldap_domains (user_id);
Configure LocalSettings.php
Add these line at the end of LocalSettings.
require_once ("$IP/extensions/LdapAuthentication/LdapAuthentication.php"); $wgAuth = new LdapAuthenticationPlugin(); $wgLDAPDomainNames = array( 'LUNIEL' ); #Domain controler of AD $wgLDAPServerNames = array( 'LUNIEL' => 'dc01.luniel.com' ); $wgLDAPSearchAttributes = array( 'LUNIEL' => 'sAMAccountName' ); $wgLDAPGroupUseFullDN = array( 'LUNIEL' => true ); $wgLDAPGroupObjectclass = array( 'LUNIEL' => 'group' ); $wgLDAPGroupAttribute = array( 'LUNIEL' => 'member' ); $wgLDAPGroupNameAttribute = array( 'LUNIEL' => 'cn' ); $wgLDAPBaseDNs = array( 'LUNIEL' => 'DC=luniel,DC=com' ); $wgLDAPGroupSearchNestedGroups = array( 'LUNIEL' => true ); $wgLDAPActiveDirectory = array( 'LUNIEL' => true ); #Security groups location $wgLDAPGroupBaseDNs = array( 'LUNIEL' => 'OU=Security Groups,OU=Groups,DC=luniel,DC=com' ); #Group we want to check $wgLDAPRequiredGroups = array( 'LUNIEL' => array('cn=grp.sec.access.wiki,ou=security groups,ou=groups,dc=luniel,dc=com') ); $wgLDAPSearchStrings = array( 'LUNIEL' => 'LUNIEL\\USER-NAME' ); $wgLDAPEncryptionType = array( 'LUNIEL' => 'none' ); $wgMinimalPasswordLength = 1; #Bind user $wgLDAPProxyAgent = array( 'LUNIEL' => 'CN=svc_ldap,OU=Service Accounts,DC=luniel,DC=com' ); $wgLDAPProxyAgentPassword = array( 'LUNIEL' => 'xxx' );
Daniel Simao (talk) 13:32, 20 July 2018 (EDT)