Created
October 10, 2017 17:41
-
-
Save jsomara/59e8fb1bf200050402a7aa6cb396b43a to your computer and use it in GitHub Desktop.
mediawiki ldap config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- use this plugin: https://www.mediawiki.org/wiki/Extension:LDAP_Authentication/Configuration_Options | |
- First, create a user in the wiki in the database with your own LDAP username, and set them as a `sysop` | |
- install the plugin for your OS as per the directions | |
- connect to the wiki db and add the `ldap_domains` table as mentioned above | |
- update the configuration file with your own settings, including the user & pass of your LDAP binder, the group (if required) for users, etc | |
- restart nginx or apache | |
- login with foxpass password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LDAP | |
require_once ('extensions/LdapAuthentication/LdapAuthentication.php'); | |
require_once ('includes/AuthPlugin.php'); | |
$wgAuth = new LdapAuthenticationPlugin(); | |
# disable local users | |
$wgLDAPUseLocal = false; | |
# extra permissions required for LDAP system to auto-create db users | |
$wgGroupPermissions['*']['autocreateaccount'] = true; | |
$wgGroupPermissions['*']['createaccount'] = true; | |
$wgLDAPDomainNames = array( | |
'ldap_foxpass_com', | |
); | |
$wgLDAPServerNames = array( | |
'ldap_foxpass_com' => 'ldap.foxpass.com', | |
); | |
$wgLDAPUseLocal = false; | |
$wgLDAPEncryptionType = array( | |
'ldap_foxpass_com' => 'ssl', | |
); | |
$wgLDAPPort = array( | |
'ldap_foxpass_com' => 636, | |
); | |
$wgLDAPProxyAgent = array( | |
'ldap_foxpass_com' => 'cn=mediawiki,dc=citrine,dc=io', | |
); | |
$wgLDAPProxyAgentPassword = array( | |
'ldap_foxpass_com' => 'xxxxxxxxxx' | |
); | |
$wgLDAPSearchAttributes = array( | |
'ldap_foxpass_com' => 'uid' | |
); | |
$wgLDAPBaseDNs = array( | |
'ldap_foxpass_com' => 'dc=citrine,dc=io', | |
); | |
# To pull e-mail address from LDAP | |
$wgLDAPPreferences = array( | |
'ldap_foxpass_com' => array( 'email' => 'mail') | |
); | |
# Group based restriction | |
$wgLDAPGroupUseFullDN = array( "ldap_foxpass_com"=>true ); | |
$wgLDAPGroupObjectclass = array( "ldap_foxpass_com"=>"posixGroup" ); | |
$wgLDAPGroupAttribute = array( "ldap_foxpass_com"=>"member" ); | |
$wgLDAPGroupSearchNestedGroups = array( "ldap_foxpass_com"=>false ); | |
$wgLDAPGroupNameAttribute = array( "ldap_foxpass_com"=>"cn" ); | |
### Users must be in a group called 'ldapwiki' for login to be successful | |
$wgLDAPRequiredGroups = array( "ldap_foxpass_com"=>array("cn=ldapwiki,ou=groups,dc=citrine,dc=io")); | |
$wgLDAPGroupsUseMemberOf = array( | |
'ldap_foxpass_com' => false | |
); | |
$wgLDAPLowerCaseUsername = array( | |
'ldap_foxpass_com' => true, | |
); | |
$wgMinimalPasswordLength = 1; | |
$wgLDAPDisableAutoCreate = array("ldap_foxpass_com"=>false); | |
### END LDAP END LDAP END LDAP | |
### EDIT EDIT ENABLE DEBUG LOGS | |
/** | |
* The debug log file must never be publicly accessible because it | |
* contains private data. But ensure that the directory is writeable by the | |
* PHP script running within your Web server. | |
* The filename is with the database name of the wiki. | |
*/ | |
$wgDebugLogFile = "/var/log/mediawiki/debug-{$wgDBname}.log"; | |
### ALSO turn on LDAP debug | |
$wgLDAPDebug = 99; | |
$wgDebugLogGroups['ldap'] = '/var/log/mediawiki/debug-ldap.log'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add an important but missing table to your wiki's db | |
CREATE TABLE ldap_domains (domain_id int not null primary key auto_increment,domain varchar(255) binary not null,user_id int not null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment