...
La déclaration d'un bean ldapUserService de cette classe ressemblera à :
Bloc de code |
---|
<bean id="ldapUserService" class="[org...]esupportail.commons.services.ldap.SearchableLdapUserServiceImpl" lazy-init="true" > <property name="ldapTemplatei18nService" ref="ldapTemplatei18nService" /> <property name="uidAttributeldapTemplate" valueref="uidldapTemplate" /> <property name="searchAttributednSubPath" value="cn" ${ldap.dnSubPath}"/> <property name="searchDisplayedAttributesidAttribute"> <list> <value>displayName</value> <value>ur1composante</value> <value>ur1typeEntree</value> </list> </property> value="${ldap.uidAttribute}"/> <property name="attributesAsString" value="${ldap.attributes}"/> <property name="searchAttribute" value="${ldap.searchAttribute}"/> <property name="searchDisplayedAttributesAsString" value="${ldap.searchDisplayedAttributes}" /> <property name="cacheManager" ref="cacheManager"/> <property name="otherAttributescacheName"> <list> <value>homeDirectory</value> </list> </property> value=""/> <property name="testFilter" value="cn=*bourges*${ldap.testFilter}" /> </bean> |
... avec dans config.properties :
Bloc de code |
---|
########################################################################
# LDAP
#
ldap.url=ldap://ldap.univ.fr:389,ldap://ldap2.univ.fr:389
ldap.userDn=uid=user,ou=comptes,dc=univ,dc=fr
ldap.password=mdp
ldap.base=dc=univ,dc=fr
ldap.dnSubPath=ou=people
ldap.uidAttribute=uid
ldap.displayNameAttribute=displayName
ldap.emailAttribute=mail
ldap.searchAttribute=cn
ldap.testFilter=cn=*bourges*
ldap.attributes=cn,displayName,employeeType,department,homeDirectory
ldap.searchDisplayedAttributes=cn,displayName,employeeType,department
|
La propriété uidAttribute donne le nom de l'attribut LDAP qui contient l'identifiant unique des utilisateurs de l'annuaire.
...