Pages enfant
  • Grouper - Store SmartLdapGroupStore (esup 4)

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.
Commentaire: Migrated to Confluence 5.3

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 :

...

Cette configuration est décrite dans le paragraphe Configuration du SmartLdapGroupStore avec un dn dans l'entrée de personne.

Activation du SmartLdapGroupStore

 

...

Prise en compte de l'attribut d’appartenance par le portail

  • Le portail doit être en mesure d'analyser les appartenances aux groupes. Il faut ajouter l'attribut qui contient les groupes de l'utilisateurs (isMemberOf / memberOf) à la liste des attributs pris en compte.

Fichier uportal-war/src/main/resources/properties/

...

contexts/

...

personDirectoryContext.xml

 

Bloc de code
<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>

Configuration du SmartLdapGroupStore avec un cn dans l'entrée de personne

 

  • Configurer le SmartLdapGroupStore dans uportal-war/src/main/resources/properties/groups/SmartLdapGroupStoreConfig.xml
languagehtml/xml
<bean id="uPortalLdapAttributeSource" class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
  <property name="contextSource" ref="defaultLdapContext" />
  <property name="queryAttributeMapping">
    <map>
      <entry key="username" value="${ldap.uidAttr}"/>
    </map>
  </property>

  <property name="resultAttributeMapping">
    <map>
      <entry key="eduPersonPrimaryAffiliation"> <value>eduPersonPrimaryAffiliation</value></entry> 
      <entry key="eduPersonAffiliation"> <value>eduPersonAffiliation</value></entry> 
      <entry key="cn"> <value>cn</value></entry>
Bloc de code
    <!--
     | This bean is the ContextSource instance that will be used to connect to LDAP.
     +-->
    <bean id="ldapContext" class="org.springframework.ldap.core.support.LdapContextSource">
      <entry  <property namekey="urldescription"> value="ldap:<value>description<//frmp0165.frml.bull.fr:389"/>value></entry>
      <entry  <property namekey="userDndisplayName" value="uid=root,dc=univ,dc=fr"/>> <value>displayName</value></entry>
      <entry  <property namekey="passwordfacsimileTelephoneNumber" value="secret"/>> <value>facsimileTelephoneNumber</value></entry>
    </bean>

    <!--<entry key="givenName"> <value>givenName</value></entry>
     | Period, in seconds, after which SmartLdap will drop and re-init the groups 
<entry key="mail"> <value>mail</value></entry>
      <entry key="postalAddress"> <value>postalAddress</value></entry>
       | tree.  A value of zero or less (negative) disables this feature.<entry key="sn"> <value>sn</value></entry>
      <entry key="telephoneNumber"> <value>telephoneNumber</value></entry>
     +-->
 <entry   <bean id="groupsTreeRefreshIntervalSeconds" class="java.lang.Long">key="${ldap.uidAttr}"> 
        <constructor-arg><value>900</value></constructor-arg><set>
    </bean>
    
    <!--
<value>${ldap.uidAttr}</value>
      |   BaseDn that<value>username</value>
 will be passed to the search (not to the context).<value>user.login.id</value>
     |   </set>
     | WARNING: </entry>
  If you get an error like this...<entry key="supannCodeINE"> <value>supannCodeINE</value></entry>
     |   ...PartialResultException: [LDAP: error code 10...
     | it probably means your baseDn isn't correct!<entry key="supannEtuId"> <value>supannEtuId</value></entry>
      <entry key="supannEmpId"> <value>supannEmpId</value></entry>
      <entry key="eduPersonAffiliation"> <value>eduPersonAffiliation</value></entry>
     +-->
 <entry   <bean idkey="baseDnsupannaffectation" class="java.lang.String">> <value>supannaffectation</value></entry>
      <entry key="objectclass"> <value>objectclass</value></entry>
      <entry  <constructor-arg><value>ou=groups,dc=univ,dc=fr<key="supannorganisme"> <value>supannorganisme</value></constructor-arg>entry>
    </bean>

 
      <!--
 Add attribute to determine |if ESUPuser Parameter.belongs 
to a group. -->
  | This parameter is <entry key="isMemberOf"> <value>isMemberOf</value></entry>
    </map>
  </property>
</bean>

 

Activation du SmartLdapGroupStore

  • Activer le SmartLdapGroupStore dans uportal-war/src/main/resources/properties/groups/compositeGroupServices.xml en dé-commentant le service smartldap :
Bloc de code
languagehtml/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>

Description de la configuration du SmartLdapGroupStore

La configuration du SmartLdapGroupStore s'effectue dans le fichier  "uportal-war/src/main/resources/properties/groups/SmartLdapGroupStoreConfig.xml"

Les propriété à configurer sont les suivants :

  •     url : l'URL de connexion à l'annuaire LDAP.
  •     userDn : le login de connexion à l'annuaire LDAP.
  •     password : le mot de passe de connexion à l'annuaire LDAP.

  •     baseDn : la branche de l'annuaire où les groupes sont stockées.
  •     filter : le filtre utilisé pour séléctionner tous les groupes à mapper.
  •     childGroupKeyRegex : une expression régulière qui permet de déterminer si les membres d'un groupe sont eux-même des groupes. L'expression régulière doit matcher si le membre est un groupe.
  •     keyIndexMatchingGroup : cet index est utilisé conjointement avec le childGroupKeyRegex pour extraire la clé du groupe.

  •     memberOfAttributeName : le nom de l'attribut, dans une entrée de personne, qui référence les groupes auxquels la personne appartient.

  •     keyAttributeName : le nom de l'attribut, dans l'entrée de groupe, qui référence la clé du groupe. Si on souhaite utiliser le dn comme clé, cette propriété doit être commentée.
  •     groupNameAttributeName: le nom de l'attribut, dans l'entrée de groupe, qui référence le nom du groupe.
  •     membershipAttributeName : : le nom de l'attribut, dans l'entrée de groupe, qui référence les membres du groupe.

Le nom du groupe est utilisé pour l'affichage. La clé du groupe est utilisée pour appeller le groupe. La clé est utilisée pour déterminer si une personne fait partie d'un groupe (en comparant avec l'attribut LDAP définit sous la propriété memberOfAttributeName).

Configuration du SmartLdapGroupStore avec un cn dans l'entrée de personne

La configuration attendue est la suivante :

Bloc de code
languagehtml/xml
    <used to extract the id path of the groups 
     | from their dn. 
     | The id path is caught from the nth group of the regex where n is the value 
     | of keyIndexMatchingGroup.
     | (http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#group%28int%29)
    -->
    <bean id="childGroupKeyRegex" class="java.lang.String">
        <constructor-arg><value>cn=(.*),ou=groups,dc=univ,dc=fr</value></constructor-arg>
    </bean>
    <bean id="keyIndexMatchingGroup" class="java.lang.Integer">
        <constructor-arg><value>1</value></constructor-arg>
    </bean>

    <!--
     | NOTE:  The remaining examples in this file are configured correctly for 
     | Active Directory servers.
     +-->

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

    <!--
     | TheseThis beansbean tellis smartLdapthe whetherContextSource to gather additional groups instance that arewill 
be used to connect to |LDAP.
 members of groups returned by+-->
 the first baseDn and filter, and where to 
<bean id="ldapContext" class="org.springframework.ldap.core.support.LdapContextSource">
        | look if so.<property name="url" value="ldap://ldap.univ.fr:389"/>
     |
   <property  |   - resolveMemberGroups=[true|false]name="userDn" value="uid=root,dc=univ,dc=fr"/>
     |   -<property resolveDn={a different, broader baseDn than the one above}name="password" value="XXXX"/>
    </bean>

     |<!--
     | Here's how it works:  smartLdapPeriod, in seconds, after which SmartLdap will first collect all groups under thedrop and re-init the groups 
     | baseDntree.  specifiedA above.value of Ifzero 'resolveMemberGroups'or is enabled, it will less (negative) disables this feature.
     | also search for additional groups (found within the 'resolveDn' specified 
     | here) that are members of groups in the first collection.
     ++-->
    <bean id="resolveMemberGroupsgroupsTreeRefreshIntervalSeconds" class="java.lang.BooleanLong">
        <constructor-arg><value>false<arg><value>900</value></constructor-arg>
    </bean>
    <bean id="resolveDn" class="java.lang.String">
    <!--
     | BaseDn  <constructor-arg><value>changeme</value></constructor-arg>
    </bean>

    <!--that will be passed to the search (not to the context).
     |
 This bean identifies the name| ofWARNING: the PersonIf Attributeyou that
get an error like this...
 | lists  the SmartLdap| groups each person is a member of....PartialResultException: [LDAP: error code 10...
     | it probably means your baseDn isn't correct!
     +-->
    <bean id="memberOfAttributeNamebaseDn" class="java.lang.String">
        <constructor-arg><value>isMemberOf<arg><value>ou=groups,dc=univ,dc=fr</value></constructor-arg>
    </bean>

    <!--
     | This bean identifies the org.springframework.ldap.core.AttributesMapper
     | implementation used in readingESUP Parameter. 
     | This parameter is used to extract the id path of the groups records
   from LDAP.
 | from their dn. +-->
     | <beanThe id="contextMapper" class="org.jasig.portal.groups.smartldap.SimpleContextMapper">
        <!--
     path is caught from the nth group of the regex where n is the value 
     | Name of thekeyIndexMatchingGroup.
 group attribute that tells you its key.| (http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#group%28int%29)
    -->
    <bean | If ommited, will use the dn.id="childGroupKeyRegex" class="java.lang.String">
         +-->
<constructor-arg><value>cn=(.*),ou=groups,dc=univ,dc=fr</value></constructor-arg>
    </bean>
    <bean <property name="keyAttributeNameid="keyIndexMatchingGroup" class="java.lang.Integer">
        <constructor-arg><value>1</value></constructor-arg>
    <value>cn<</value>
    bean>

    </property>!--
     | NOTE:  <!--
The remaining examples in this file are configured correctly |for Name
 of the group attribute that| tellsActive youDirectory its nameservers.
     +-->

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

    <!--
     | These beans tell |smartLdap Namewhether ofto thegather groupadditional attributegroups that listsare its members.
     | members of groups +-->
returned by the first baseDn and filter, and <property name="membershipAttributeName">where to 
     | look if so.
     <value>member</value>|
     |   </property>
    </bean>

Le code utilise les attributs suivant comme suit :

  1. Recherche de tous les groupes
  2. Pour chaque groupe
    1. Extraire l'attribut qui servira clé (keyAttributeName ou bien le dn du groupe si le keyAttributeName n'existe pas)
    2. Extraire l'attribut qui servira de nom (groupNameAttributeName)
    3. Extraire la liste des membres (membershipAttributeName)
    4. Pour chaque membre
      1. Vérifier s'il s'agit d'un groupe (en vérifiant que l'expression matche childGroupKeyRegex)
      2. S'il s'agit bien d'un groupe, extraire la clé en utilisant le groupe dont l'index est keyIndexMatchingGroup
      3. Insérer le sous-groupe en tant qu'enfant du groupe

Lors de la recherche de l'appartenance d'une personne à un groupe, le test se fera en parcourant l'attribut memberOfAttributeName et en effectuant une comparaison avec la clé des groupes.

Configuration du SmartLdapGroupStore avec un dn dans l'entrée de personne

 

  • Configurer le SmartLdapGroupStore dans uportal-war/src/main/resources/properties/groups/SmartLdapGroupStoreConfig.xml
Bloc de code
    <!--
     | 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://frmp0165.frml.bull.fr:389"/- resolveMemberGroups=[true|false]
     |   - resolveDn={a different, broader baseDn than the one above}
     |
     | Here's how it works:  smartLdap will first collect all groups under the 
     | baseDn specified above.  If 'resolveMemberGroups' is enabled, it will 
     | also search for additional groups (found within the 'resolveDn' specified 
     | here) that are members of groups in the first collection.
     +-->
    <bean id="resolveMemberGroups" class="java.lang.Boolean">
        <constructor-arg><value>false</value></constructor-arg>
    </bean>
    <bean id="resolveDn" class="java.lang.String">
        <constructor-arg><value>changeme</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">
        <property name="userDn" value="uid=root,dc=univ,dc=fr"/>
        <property name="password" value="secret"/><constructor-arg><value>isMemberOf</value></constructor-arg>
    </bean>

    <!--
     | Period,This inbean seconds,identifies after which SmartLdap will drop and re-init the groups 
     | tree.  A value of zero or less (negative) disables this featurethe org.springframework.ldap.core.AttributesMapper
     | implementation used in reading the groups records from LDAP.
     +-->
    <bean id="groupsTreeRefreshIntervalSecondscontextMapper" class="java.lang.Longorg.jasig.portal.groups.smartldap.SimpleContextMapper">
        <constructor-arg><value>900</value></constructor-arg><!--
    </bean>
     
| Name of  <!--
  the group attribute that tells you its key.
   | BaseDn that will be passed to| theIf searchommited, (notwill touse the context)dn.
     |
    +-->
 | WARNING:  If you get an error like this...<property name="keyAttributeName">
     |   ...PartialResultException: [LDAP: error code 10... <value>cn</value>
     | it probably means your baseDn isn't correct!
 </property>
        +<!-->
    <bean id="baseDn" class="java.lang.String">
   | Name of the  <constructor-arg><value>ou=groups,dc=univ,dc=fr</value></constructor-arg>
    </bean>

group attribute that tells you its name.
         <!+-->
      | ESUP Parameter. <property name="groupNameAttributeName">
     |   This parameter is used to<value>cn</value>
 extract the id path of the groups </property>
     | from their dn.  <!--
     | The id path is| caughtName fromof the nth group ofattribute thethat regexlists where n is the value 
     | of keyIndexMatchingGroup.
 its members.
    | (http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#group%28int%29)
    +-->
     <bean id="childGroupKeyRegex" class="java.lang.String   <property name="membershipAttributeName">
        <constructor-arg><value>cn=(.*),ou=groups,dc=univ,dc=fr</value></constructor-arg>
     </bean>
    <bean id="keyIndexMatchingGroup" class="java.lang.Integer"><value>member</value>
        <constructor-arg><value>0</value></constructor-arg></property>
    </bean>

Le code utilise les attributs comme suit :

  1. Recherche de tous les groupes
  2. Pour chaque groupe
    1. Extraire l'attribut qui servira clé soit le cn (keyAttributeName)
    2. Extraire l'attribut qui servira de nom soit le cn (groupNameAttributeName)
    3. Extraire la liste des membres en interrogeant l'attribut member (membershipAttributeName)
    4. Pour chaque membre
      1. Vérifier s'il s'agit d'un groupe en vérifiant que l'expression matche l'expression cn=(.*),ou=groups,dc=univ,dc=fr (childGroupKeyRegex)
      2. S'il s'agit bien d'un groupe, extraire la clé en utilisant le groupe dont l'index est 1 (keyIndexMatchingGroup). Cela renvoie donc le cn du groupe.
      3. Insérer le sous-groupe en tant qu'enfant du groupe

 

Configuration du SmartLdapGroupStore avec un dn dans l'entrée de personne


La configuration attendue est la suivante :

Bloc de code
languagehtml/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://frmp0165.frml.bull.fr:389"/>
        <property name="userDn" value="uid=root,dc=univ,dc=fr"/>
        <property name="password" value="secret"/>
    </bean>

    <!--
     | Period, in seconds, after which SmartLdap will drop and re-init the groups 
     | tree.  A value of zero or less (negative) disables this feature.
     +-->
    <bean id="groupsTreeRefreshIntervalSeconds" class="java.lang.Long">
        <constructor-arg><value>900</value></constructor-arg>
    </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!
     +-->    <!--
     | NOTE:  The remaining examples in this file are configured correctly for 
     | Active Directory servers.
     +-->

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

    <!--
     | These beans tell smartLdap whether to gather additional groups that are 
     | members of groups returned by the first baseDn and filter, and where to 
     | look if so.
     |
     |   - resolveMemberGroups=[true|false]
     |   - resolveDn={a different, broader baseDn than the one above}
     |
     | Here's how it works:  smartLdap will first collect all groups under the 
     | baseDn specified above.  If 'resolveMemberGroups' is enabled, it will 
     | also search for additional groups (found within the 'resolveDn' specified 
     | here) that are members of groups in the first collection.
     +-->
    <bean id="resolveMemberGroups" class="java.lang.Boolean">
        <constructor-arg><value>false</value></constructor-arg>
    </bean>
    <bean id="resolveDnbaseDn" class="java.lang.String">
        <constructor-arg><value>changeme<arg><value>ou=groups,dc=univ,dc=fr</value></constructor-arg>
    </bean>

    <!--
     | ESUP Parameter. 
     | This bean identifiesparameter is used to extract the id namepath of the Person Attributegroups that
     | listsfrom thetheir SmartLdapdn. groups
 each person is a member| of.
The id path is caught +-->
from the nth group <bean id="memberOfAttributeName" class="java.lang.String">
        <constructor-arg><value>isMemberOf</value></constructor-arg>
    </bean>

    <!--of the regex where n is the value 
     | of keyIndexMatchingGroup.
     | This bean identifies the org.springframework.ldap.core.AttributesMapper
     | implementation used in reading the groups records from LDAP.
     +-->
    <bean id="contextMapper" class="org.jasig.portal.groups.smartldap.SimpleContextMapper">
        <!--
         | Name of the group attribute that tells you its key.
         | If ommited, will use the dn.
         +-->
		<!--
        <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>

Prise en compte du SmartLdapGroupStore dans les groupes uPortal

  • Ajouter les groupes smartLDAP à votre arborescence des groupes. Par exemple, vous pouvez modifier le fichier Everyone.group-membership.xml comme suit :

...

(http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#group%28int%29)
    -->
    <bean id="childGroupKeyRegex" class="java.lang.String">
        <constructor-arg><value>cn=(.*),ou=groups,dc=univ,dc=fr</value></constructor-arg>
    </bean>
    <bean id="keyIndexMatchingGroup" class="java.lang.Integer">
        <constructor-arg><value>0</value></constructor-arg>
    </bean>

    <!--
     | NOTE:  The remaining examples in this file are configured correctly for 
     | Active Directory servers.
     +-->

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

    <!--
     | These beans tell smartLdap whether to gather additional groups that are 
     | members of groups returned by the first baseDn and filter, and where to 
     | look if so.
     |
     |   - resolveMemberGroups=[true|false]
     |   - resolveDn={a different, broader baseDn than the one above}
     |
     | Here's how it works:  smartLdap will first collect all groups under the 
     | baseDn specified above.  If 'resolveMemberGroups' is enabled, it will 
     | also search for additional groups (found within the 'resolveDn' specified 
     | here) that are members of groups in the first collection.
     +-->
    <bean id="resolveMemberGroups" class="java.lang.Boolean">
        <constructor-arg><value>false</value></constructor-arg>
    </bean>
    <bean id="resolveDn" class="java.lang.String">
        <constructor-arg><value>changeme</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="contextMapper" class="org.jasig.portal.groups.smartldap.SimpleContextMapper">
        <!--
         | Name of the group attribute that tells you its key.
         | If ommited, will use the dn.
         +-->
		<!--
        <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>

 Le code utilise les attributs comme suit :

  1. Recherche de tous les groupes
  2. Pour chaque groupe
    1. Extraire l'attribut qui servira clé soit le dn en l'absence de keyAttributeName
    2. Extraire l'attribut qui servira de nom soit le cn (groupNameAttributeName)
    3. Extraire la liste des membres soit les member (membershipAttributeName)
    4. Pour chaque membre
      1. Vérifier s'il s'agit d'un groupe en vérifiant que l'expression matche l'expression cn=(.*),ou=groups,dc=univ,dc=fr (childGroupKeyRegex)
      2. S'il s'agit bien d'un groupe, extraire la clé en utilisant le groupe dont l'index est 0 (keyIndexMatchingGroup). Cela renvoie donc le dn du groupe.
      3. Insérer le sous-groupe en tant qu'enfant du groupe

Prise en compte du SmartLdapGroupStore dans les groupes uPortal

  • Ajouter les groupes smartLDAP à votre arborescence des groupes. Par exemple, on peut modifier le fichier Everyone.group-membership.xml comme suit :
Bloc de code
languagehtml/xml
<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>

 

  • L'import du fichier modifié s'effectue via la tâche d'import du portail. L'arborescence des groupes est alors construite. Dans les logs, on peut lire l'ensemble des groupes importés.
Bloc de code
ant data-import -Dfile=uportal-war/src/main/data/quickstart_entities/group_membership/Everyone.group-membership.xml
>>>
...
     [java]  INFO SmartLdap adding record for group:  esup:etablissements:etablissement_5:composantes:composante_17:tous with key esup:etablissements:etablissement_5:composantes:composante_17:tous

     [java]  INFO SmartLdap adding record for group:  esup:etablissements:etablissement_5:composantes:composante_18:tous with key esup:etablissements:etablissement_5:composantes:composante_18:tous

     [java]  INFO SmartLdap adding record for group:  esup:etablissements:etablissement_5:composantes:composante_19:tous with key esup:etablissements:etablissement_5:composantes:composante_19:tous

     [java]  INFO SmartLdap adding record for group:  esup:etablissements:etablissement_5:composantes:composante_20:tous with key esup:etablissements:etablissement_5:composantes:composante_20:tous
..


 

  • On peut aussi vérifier les groupes importés via l'outil de gestion des groupes du portail.

Appel d'un groupe provenant du SmartLdapGroupStore

 

On cible un groupe en le désignant par son nom (et non par la clé). Par exemple, dans un fichier de channel, on écrira :

Bloc de code
languagehtml/xml
<group>admin:appli:appli1</group>

 Il faudra ensuite réimporter le fichier via la commande d'import pour qu'il soit pris en compte par le portail.