![]()
Seit geraumer Zeit ist bei uns das freie Wikisystem DokuWiki im Einsatz.
Um die Ergonomie und Verwaltung zu erleichtern, haben wir das wiki an unser ActiveDirectory angebunden.
Die Authentifizierung aus verschiedenen Netzen macht mod_ldap:
Apache Vhost config:
# LDAP Authentication & Authorization is final; do not check other databases
AuthzLDAPAuthoritative off# Do basic password authentication in the clear
AuthType Basic# The name of the protected area or “realm”
AuthName “Use AD Account for authentification”AuthBasicProvider ldap
# Active Directory requires an authenticating DN to access records
# This is the DN used to bind to the directory service
# This is an Active Directory user account
AuthLDAPBindDN “CN=USERNAME,OU=P-R,OU=P,OU=Organization,DC=intranet,DC=dmz”# This is the password for the AuthLDAPBindDN user in Active Directory
AuthLDAPBindPassword “PASSWORD”# The LDAP query URL
# Format: scheme://host:port/basedn?attribute?scope?filter
# The URL below will search for all objects recursively below the basedn
# and validate against the sAMAccountName attribute
# AuthLDAPURL “ldap://DOMAINCONTROLLER IP/HOST:389 OU=Organization,DC=intranet,DC=dmz?sAMAccountName?sub?(objectClass=*)”
AuthLDAPURL “ldaps://DOMAINCONTROLLER IP/HOST:636/OU=Organization,DC=intranet,DC=dmz?sAMAccountName?sub?(objectClass=*)”
AuthUserFile /dev/null# Require authentication for this Location
Require valid-user
Mod_LDAP gibt die Credentials dann an Dokuwiki weiter, welches uns über das Plugin Auth:AD authentifiziert:
local.php
// configure your Active Directory data here
$conf['auth']['ad']['account_suffix'] = ‘@intranet.dmz’;
$conf['auth']['ad']['base_dn'] = ‘DC=intranetDC=dmz’;
$conf['auth']['ad']['domain_controllers'] = ‘DOMAINCONTROLLER IP/HOST‘; //multiple can be given
$conf['auth']['ad']['sso'] = 1;
$conf['auth']['ad']['ad_username'] = ‘USERNAME‘;
$conf['auth']['ad']['ad_password'] = ‘password‘;
$conf['auth']['ad']['real_primarygroup'] = 1;
$conf['auth']['ad']['use_ssl'] = 1;
$conf['auth']['ad']['debug'] = 0;
Die Superuser Gruppe enthält alle User, die im Wiki Admin Rechte bekommen sollen:
$conf['superuser'] = ‘@gr_lok_wiki_admin’;
Zugriffe kann man dann ganz normal über das ACL plugin verteilen und in der acl.auth.php von DokuWiki konfiguriert werden. Aufpassen muss man allerdings bei Benutzergruppen die Sonderzeichen enthalten:
acl.auth.php
* @gr%5flok%5falle 8
Die Gruppe “gr_lok_allle” enthält uneingeschränkten Zugriff auf alle Wiki Seiten. Das Sonderzeichen “_” muss mit “%5f” escaped werden.
acl.auth.php
production:* @ALL 0
production:* @gr%5flok%5fbetrieb 8
Der Namespace “production” darf von niemandem gelesen werden, die Gruppe “gr_lok_betrieb” hat uneingeschränkten Zugriff.
Hallo Andy,
bin Deinem Howto gefolgt – wird bei Dir beim Aufruf der Seite nach dem Benutzer und PW gefragt? bei mir ja, irgendwas scheint zu fehlen?!
MfG
Peter
Hi Peter,
Ich verstehe nicht ganz, das ist doch Sinn und Zweck der Sache, dass danach der Aufruf zu Benutzer und PW kommt?
Das wird dann eben .htaccess typisch abgefragt und dann im Browser gecached, also danach bist du mit deinem AD Account eingeloggt.
wie lässt sich im dokuwiki denn dann einstellen, welche user zugriff haben? oder sind das automatisch alle aus dem ad? also gibts so eine option wie superuser nicht auch für normale wiki user?
Hi Actron,
Wenn du in der $conf['auth']['ad']['base_dn'] keine Einschränkung auf Gruppen gemacht hast, so kannst du das über die Datei acl.auth.php regeln.
Beispiel:
restriced:* @ALL 0
restricted:* @restrictedgroup 16
Der Namespace restricted wäre für alle Mitglieder gesperrt, ausser für diejenigen, die in der Gruppe restrictedgroup sind.
hallo andy, danke für die antwort. problem ist, dass ich null erfahrung mit ad hab und jetzt ein wiki daran anbinden soll.
also könnte ich z. b. $conf['auth']['ad']['base_dn'] = ‘ou=wikiuser, dc=my, dc=domain, dc=tld’; schreiben, wobei wikiuser eine gruppe im ad ist? und dann hat nur diese gruppe zugriff auf das wiki?
ich tue mich noch etwas schwer damit, was nun ad gruppen und dokuwiki gruppen sind. aber die gruppen, die man ohne ad in der acl hatte, gibt es jetzt wahrscheinlich gar nicht mehr, oder!? aber werd das mit dem ou=wikiuser mal testen.
Ja das sollte so gehen. Ansonsten wie gesagt die Gruppe einfach auch noch in die acl.auth.php mit aufnehmen und alle anderen da “aussperren”.