Usare Xwiki con validazione su Active Directory
Per gestire la nostra “Biblioteca Aziendale”, oltre che della bibliotecaria qui accanto
, ho avuto bisogno di implementare un Wiki.
Mi è stato imposto di usare XWiki, un wiki scritto in java che gira ovviamente con Tomcat (nel mio caso su linux).
A differenza di altre applicazioni scritte in Java in cui sono imbattutto ultimamente non è affatto pesante e si è installato in 5 minuti su una Debian Stabile.
Ovviamente, come da policy aziendale, le genti che lo usano si devono validare con l’Active Directory del dominio interno dell’azienda e per fare questo ci sono alcune piccole modifiche da fare sul file di configurazione di default.
Dobbiamo creare per prima cosa un utente sul dominio con una passowrd che non scade, l’utente può avere il livello “user”, non serve che sia amministratore del dominio, serve solo a stabile una connessione con l’Active Directory, e validarsi per poter prelevare le informazioni che servono. Poniamo che l’utente sia pippo e il dominio si chiami miodominio.local
#-# new LDAP authentication service
xwiki.authentication.authclass=com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl
#-# Turn LDAP authentication on – otherwise only XWiki authentication
#-# 0: disable
#-# 1: enable
xwiki.authentication.ldap=1
#-# LDAP Server (Active Directory, eDirectory, OpenLDAP, etc.)
xwiki.authentication.ldap.server=192.168.42.44 <-L’indirizzo ip di uno qualunque dei domain controller del dominio
xwiki.authentication.ldap.port=389
#-# LDAP login, empty = anonymous access, otherwise specify full dn
#-# {0} is replaced with the username, {1} with the password
xwiki.authentication.ldap.bind_DN=CN=pippo,CN=Users,DC=miodominio,DC=local
xwiki.authentication.ldap.bind_pass=la_password_di_pippo
#-# Force to check password after LDAP connection
#-# 0: disable
#-# 1: enable
xwiki.authentication.ldap.validate_password=0
#-# base DN for searches
xwiki.authentication.ldap.base_DN=dc=miodominio,dc=local
#-# Specifies the LDAP attribute containing the identifier to be used as the XWiki name (default=cn)
xwiki.authentication.ldap.UID_attr=sAMAccountName
#-# [Since 1.5M1, XWikiLDAPAuthServiceImpl]
#-# The potential LDAP groups classes. Separated by commas.
xwiki.authentication.ldap.group_classes=group,groupOfNames,groupOfUniqueNames,dynamicGroup,dynamicGroupAux,groupWiseDistributionList
#-# [Since 1.5M1, XWikiLDAPAuthServiceImpl]
#-# The potential names of the LDAP groups fields containings the members. Separated by commas.
xwiki.authentication.ldap.group_memberfields=user
#-# retrieve the following fields from LDAP and store them in the XWiki user object (xwiki-attribute=ldap-attribute)
xwiki.authentication.ldap.fields_mapping=name=sAMAccountName,last_name=sn,first_name=givenName,fullname=displayName,email=mail,ldap_dn=dn
#-# [Since 1.3M2, XWikiLDAPAuthServiceImpl]#-# on every login update the mapped attributes from LDAP to XWiki otherwise this happens only once when the XWiki account is created.
xwiki.authentication.ldap.update_user=1
#-# [Since 1.3M2, XWikiLDAPAuthServiceImpl]
#-# – create : synchronize group membership only when the user is first created
#-# – always: synchronize on every login
xwiki.authentication.ldap.mode_group_sync=always
#-# [Since 1.3M2, XWikiLDAPAuthServiceImpl]
#-# if ldap authentication fails for any reason, try XWiki DB authentication with the same credentials
xwiki.authentication.ldap.trylocal=1
#-# [Since 1.3M2, XWikiLDAPAuthServiceImpl]
#-# SSL connection to LDAP server
#-# 0: normal
#-# 1: SSL
xwiki.authentication.ldap.ssl=0
Inoltre, se volete pubblicare il vostro XWiki over https potete usare questa guida che ho scritto a suo tempo che si adatta benissimo.