This auth backend allows DokuWiki to authenticate against a Active Directory Server.
While Active Directory authentication can be set up with the default LDAP backend it should be easier to do with this dedicated auth backend. It makes use of the excellent adLDAP library and is based on the work by James Van Lommel. You do not need to download the adLDAP library yourself, it is included with DokuWiki.
In addition it allows the use of NTLM and Kerberos based Single-Sign-On.
This backend is included in DokuWiki since version rc2009-12-02 “Mulled Wine”.
To avoid having them overridden by the config manager it is recommended to place the configuration in conf/local.protected.php.
You probably want to set at least these options:
<?php // general DokuWiki options $conf['useacl'] = 1; $conf['disableactions'] = 'register'; $conf['authtype'] = 'ad'; // configure your Active Directory data here $conf['auth']['ad']['account_suffix'] = '@my.domain.org'; $conf['auth']['ad']['base_dn'] = 'DC=my,DC=domain,DC=org'; $conf['auth']['ad']['domain_controllers'] = 'srv1.domain.org, srv2.domain.org'; //multiple can be given
Optionally the following parameters can be given:
$conf['auth']['ad']['ad_username'] = 'root'; $conf['auth']['ad']['ad_password'] = 'pass'; $conf['auth']['ad']['sso'] = 1; $conf['auth']['ad']['real_primarygroup'] = 1; $conf['auth']['ad']['use_ssl'] = 1; $conf['auth']['ad']['debug'] = 1; $conf['auth']['ad']['recursive_groups'] = 1; // If number of groups in AD is large switching to 0 will improve performance, but indirect membership will not work
ad_username and ad_password are e.g. required to enable user email subscriptions. This account binds to the AD for querying user details.
Use this code snippet in local.protected.conf to set superuser rights:
$conf['manager'] = '@LDAPGROUPNAME'; $conf['superuser'] = '@LDAPGROUPNAME';
Any other options given in $conf['auth']['ad'] are directly passed to the adldap library. Please refer to the adLDAP documentation for a detailed description of what other options might be available.
In combination with Single-Sign-On, you can also add Windows domain specific setups. Eg. to authenticate against different Active Directory Servers depending on the NTLM or Kerberos Domain of a given user. The (lowercased) Domain just has to be used as a subkey to the $conf['auth']['ad'] setting. Eg. to identify all users coming from the Foobar Windows Domain using a non-default AD Server and user just put the following additional lines into your config:
$conf['auth']['ad']['foobar']['account_suffix'] = '@foobar.domain.org'; $conf['auth']['ad']['foobar']['base_dn'] = 'DC=foobar,DC=domain,DC=org'; $conf['auth']['ad']['foobar']['domain_controllers'] = 'otherad.domain.org'; $conf['auth']['ad']['foobar']['ad_username'] = 'otherroot'; $conf['auth']['ad']['foobar']['ad_password'] = 'otherpass';
Group and user names are cleaned up internally so they might differ from what is configured in your Active Directory server. Spaces are replaced with underscore and backslashes and hash symbols are removed.
Example: Domain Users becomes Domain_Users in DokuWiki.
Keep this in mind when specifying users and groups in ACL setup or configuration.
Single Sign On (SSO) means that DokuWiki will use your Windows login name to identify you without the need for you to log in. This relies on the server setting the REMOTE_USER environment variable. The ad backend then will use this username to fetch additional data like your group membership.
To make this work you need to enable the sso setting in local.protected.php and most probably also need to setup a management account with enough permissions to fetch the user info:
$conf['auth']['ad']['sso'] = 1; $conf['auth']['ad']['ad_username'] = 'MyManager'; $conf['auth']['ad']['ad_password'] = 'ManagerPass';
Additonally some setting have to be made for your server and the used Browser.
First configure IIS to use the Windows Logon for authentication (see screenshots):
inetmgrThen make sure NTLM is used as authentication protocol. This has to be done on the commandline:
cmdcd \Inetpub\Adminscriptscscript adsutil.vbs get w3svc/NTAuthenticationProviderscscript adsutil.vbs set w3svc/NTAuthenticationProviders “NTLM”Now restart IIS.
Download http://sourceforge.net/projects/mod-auth-sspi/ Copy the mod_auth_sspi.so file into your apache modules directory. Add into httpd.conf:
LoadModule sspi_auth_module modules/mod_auth_sspi.so
<Directory "c:/wamp/www/">
AuthName "My Intranet"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
require valid-user
</Directory>
Now restart Apache
add info about mod_ntlm and similar here
This setup enables an Apache Server on Linux to verify Kerberos Tickets against an Active Directory server.
Good references for Apache/Kerberos can be found at
The following examples assume your wiki to be running on dokuwiki.yourdomain.com, with your Active Directory server running at dc1.yourdomain.com;
Note: Kerberos is case sensitive, if it is all caps - it should be!
/etc/krb5.conf:
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = YOURDOMAIN.COM
ticket_lifetime = 24h
forwardable = yes
[realms]
YOURDOMAIN.COM = {
kdc = dc1.yourdomain.com
admin_server = dc1.yourdomain.com
default_domain = yourdomain.com
}
[domain_realm]
dokuwiki.yourdomain.com = YOURDOMAIN.COM
.yourdomain.com = YOURDOMAIN.COM
yourdomain.com = YOURDOMAIN.COM
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
kinit username@YOURDOMAIN.COM klist kdestroy
ktpass -princ HTTP/dokuwiki.yourdomain.com@YOURDOMAIN.COM -mapuser name_of_ad_user_you_have_created -crypto DES-CBC-MD5 -ptype KRB5_NT_PRINCIPAL -mapop set +desonly -pass the_ad_users_password -out dokuwiki.HTTP.keytab
<Directory "/var/www/html/dokuwiki"> # Kerberos Auth AuthType Kerberos KrbAuthRealms YOURDOMAIN.COM KrbServiceName HTTP Krb5Keytab /etc/httpd/conf/dokuwiki.HTTP.keytab KrbMethodNegotiate on KrbMethodK5Passwd on require valid-user </Directory>
Your browser needs to be setup to forward authentication info to the Webserver.
add detailed description
http://intranet.company.com,http://email.company.lan
Notice that you can use a comma separated list in this field.