Pages enfant
  • Grouper - Store SmartLdapGroupStore (esup 4)

Vous regardez une version antérieure (v. /wiki/pages/viewpage.action?pageId=273416195) de cette page.

afficher les différences afficher l'historique de la page

« Afficher la version précédente Vous regardez la version actuelle de cette page. (v. 7) afficher la version suivante »

Cette page est destinée aux intégrateurs.

Références

Documentation officielle pour la configuration du SmartLdapGroupStore dans uPortal : https://wiki.jasig.org/display/UPM40/SmartLdapGroupStore

Contexte

Le gestionnaire de grouper Grouper fourni par uPortal est jugé non pertinent (performance, tolérance aux pannes). La solution proposée est d'utiliser le SmartLdapGroupStore adapté à la façon dont Grouper exporte des groupes dans le LDAP.

Données utilisées

Dans les paragraphes suivants, la configuration est présentée pour un annuaire LDAP configuré comme suit :

  • dc=example,dc=org
    • ou=personnes
      • uid=user1
      • uid=user2
      • ....
    • ou=groups
      • cn=groupe1
      • cn=groupe2
      • ...

Les groupes sont des groupes exportés par grouper.Le cn est donc de la forme : folder1:folder2:nom. Par exemple : admin:appli:appli1

Les groupes ont pour objectClass eduMember.

Les membres des groupes sont connus via l'attribut member.

dn: cn=admin:appli:appli1,ou=groups,dc=aquitaine,dc=fr
objectClass: eduMember
cn: admin:appli:appli1
member: uid=user1,ou=personnes,dc=example,dc=org
member: uid=user2,ou=personnes,dc=example,dc=org

Au sein d'une entrée de personnes, on connait les groupes dont il est membre en interrogeant l'attribut isMemberOf.

dn: uid=user1,ou=personnes,dc=example,dc=org
uid: user1
objectClass: ...
isMemberOf: cn=admin:appli:appli1,ou=groups,dc=aquitaine,dc=fr

Activation du SmartLdapGroupStore

 

  • Activer le SmartLdapGroupStore dans uportal-war/src/main/resources/properties/groups/compositeGroupServices.xml
<service>
    <name>smartldap</name>
    <service_factory>org.jasig.portal.groups.ReferenceIndividualGroupServiceFactory</service_factory>
    <entity_store_factory>org.jasig.portal.groups.smartldap.SmartLdapEntityStore$Factory</entity_store_factory>
    <group_store_factory>org.jasig.portal.groups.smartldap.SmartLdapGroupStore$Factory</group_store_factory>
	<entity_searcher_factory>org.jasig.portal.groups.smartldap.SmartLdapEntitySearcher$Factory</entity_searcher_factory>
    <internally_managed>false</internally_managed>
    <caching_enabled>true</caching_enabled>
  </service>
  • Configurer le SmartLdapGroupStore dans uportal-war/src/main/resources/properties/groups/SmartLdapGroupStoreConfig.xml
    <!--
     | This bean is the ContextSource instance that will be used to connect to LDAP.
     +-->
    <bean id="ldapContext" class="org.springframework.ldap.core.support.LdapContextSource">
        <property name="url" value="ldap://ldapserveur:389"/>
        <property name="userDn" value="uid=root,dc=example,dc=org"/>
        <property name="password" value="XXX"/>
    </bean>

    <!--
     | BaseDn that will be passed to the search (not to the context).
     |
     | WARNING:  If you get an error like this...
     |   ...PartialResultException: [LDAP: error code 10...
     | it probably means your baseDn isn't correct!
     +-->
    <bean id="baseDn" class="java.lang.String">
        <constructor-arg><value>ou=groups,dc=example,dc=org</value></constructor-arg>
    </bean>

    <!--
     | ESUP Parameter.
     | This parameter is used to extract the id path of the groups
     | form their dn. The id path is expected to be catched from the first group
     | of the regex.
    -->
    <bean id="childGroupKeyRegex" class="java.lang.String">
        <constructor-arg><value>cn=(.*),ou=groups,dc=example,dc=org</value></constructor-arg>
    </bean>

    <!--
     | LDAP query string that will be passed to the search.
     +-->
    <bean id="filter" class="java.lang.String">
        <constructor-arg><value>(objectClass=eduMember)</value></constructor-arg>
    </bean>

    <!--
     | This bean identifies the name of the Person Attribute that
     | lists the SmartLdap groups each person is a member of.
     +-->
    <bean id="memberOfAttributeName" class="java.lang.String">
        <constructor-arg><value>isMemberOf</value></constructor-arg>
    </bean>

    <!--
     | This bean identifies the org.springframework.ldap.core.AttributesMapper
     | implementation used in reading the groups records from LDAP.
     +-->
    <bean id="attributesMapper" class="org.jasig.portal.groups.smartldap.SimpleAttributesMapper">
        <!--
         | Name of the group attribute that tells you its key.
         +-->
        <property name="keyAttributeName">
            <value>cn</value>
        </property>
        <!--
         | Name of the group attribute that tells you its name.
         +-->
        <property name="groupNameAttributeName">
            <value>cn</value>
        </property>
        <!--
         | Name of the group attribute that lists its members.
         +-->
        <property name="membershipAttributeName">
            <value>member</value>
        </property>
    </bean>

 

  • Ajouter les groupes smartLDAP à votre arboresence des groupes. Par exemple, vous pouvez modifier le fichier Everyone.group-membership.xml comme suit :
<group script="classpath://org/jasig/portal/io/import-group_membership_v3-2.crn">
  <name>Everyone</name>
  <entity-type>org.jasig.portal.security.IPerson</entity-type>
  <creator>system</creator>
  <description>All Users</description>
  <children>
    <group>Authenticated Users</group>
    <group>PAGS Root</group>
    <group>Faculty</group>
    <group>Guests</group>
    <group>Portal System</group>
    <group>Staff</group>
    <group>Students</group>
    <!-- Ajout des groupes SmartLdap -->
    <group>SmartLdap ROOT</group>
  </children>
</group>

 

  • Il est possible de cibler un groupe spécifique simplement en le nommant. Par exemple :
<group>admin:appli:appli1</group>



  • Aucune étiquette