ejabberd - Comments for "yet another mod_shared_roster_ldap questions" https://www.ejabberd.im/node/22850 en My goodness, @mikekaganski! https://www.ejabberd.im/node/22850#comment-64739 <p>My goodness, @mikekaganski! It seems you're onto something! Every time I look at the documentation, I understand the purpose of each line differently. I settled on all of the above based on the feedback from the ldap, and trying to get the components to return (ldap_groupdesc, ldap_memberattr, ldap_groupattr, I guess). Clearly that was an incomplete understanding. Based on your description, I think I understand what is going on. </p> <p>First, I thought the process went as follows:</p> <ol> <li>Search for groups and find members in that group</li> <li>Query each member of group (e.g. "RYDP") and get their JID and User Description</li> <li>Assign each of these query members to the group query (e.g. "RYDP")</li> </ol> <p>Instead, the process seems to be:</p> <ol> <li>Search for groups and find members in that group</li> <li>Query each member of group (e.g. "RYDP") and get their JID and User Description and Group affiliation (again, need "RYDP")</li> <li>Assign each of these query members to their affiliation (e.g. "RYDP" in the above example)</li> </ol> <p>My only annoyance is that because I have to query each user's affiliation (even after I search for the memberof), I have to retain their affiliation in two places (one in a group assignment, and one in a 'department'). I can't say I really understand this process, but for now, it seems to be populating properly.</p> <p>Here is what my working <code>mod_shared_roster_ldap</code> now looks like:</p> <blockquote><p> {mod_shared_roster_ldap,[<br /> {ldap_base, "cn=Users,dc=opto,dc=lab"},<br /> {ldap_filter, ""},<br /> {ldap_rfilter, "(&amp;(objectclass=Group)(description=department))"},<br /> {ldap_groupattr, "cn"},<br /> {ldap_gfilter, "(memberof=CN=%g,CN=Users,DC=opto,DC=lab)"},<br /> {ldap_groupdesc, "department"}, %this is requested from each user<br /> {ldap_memberattr, "sAMAccountName"},<br /> {ldap_useruid, "sAMAccountName"},<br /> {ldap_userdesc, "cn"},<br /> {ldap_user_cache_validity, "10"},<br /> {ldap_group_cache_validity, "10"}<br /> ]}, </p></blockquote> <p>Thank you for your help!</p> Thu, 14 Aug 2014 17:44:43 +0000 bedfordr comment 64739 at https://www.ejabberd.im See comments in the quote https://www.ejabberd.im/node/22850#comment-64722 <p>See comments in the quote below.</p> <div class="quote-msg"> <div class="quote-author"><em>bedfordr</em> wrote:</div> <p>----ejabberd.cfg outtake-------------------------<br /> {mod_shared_roster_ldap,[<br /> {ldap_base, "cn=Users,dc=example,dc=com"},<br /> {ldap_filter, ""},<br /> {ldap_rfilter, "(&amp;(objectclass=Group)(description=department))"}, <strong>-&gt; Well, you seem to get the list of groups that have string "department" as their description. OK.</strong><br /> {ldap_groupattr, "cn"},<br /> {ldap_gfilter, "(memberof=CN=%g,CN=Users,DC=example,DC=com)"},<strong>-&gt; Now you find users that belong to those groups. OK.</strong><br /> {ldap_groupdesc, "mail"}, )"},<strong>-&gt; Now you get the users' mails as their <em>group names</em>. Is this OK? They will likely go to individual groups... Well, that's not gonna prevent it from working, fix later.</strong><br /> {ldap_memberattr, "sAMAccountName"},)"}, <strong>-&gt; User name is in this attribute. OK.</strong><br /> {ldap_memberattr_format, "CN=%u,CN=Users,DC=example,DC=com"}, <strong>-&gt; Here it is! You tell ejabberd that the string in sAMAccountName looks like "CN=%u,CN=Users,DC=example,DC=com", and ask it to only use what is in place of "%u". Buth that's not like that! You need to omit this param, or use just "%u" here!</strong><br /> {ldap_ufilter, "distinguishedName=%u"}, <strong>-&gt; This won't work either. There's no user that has DN that looks like "barf" or "test".</strong><br /> {ldap_useruid, "mail"}, <strong>-&gt; This has to be sAMAccountName. Maybe there's something different now, but in some versions there had been a check that this value is the same as in ldap_memberattr.</strong><br /> {ldap_userdesc, "cn"},<br /> {ldap_user_cache_validity, "10"},<br /> {ldap_group_cache_validity, "10"}<br /> ]},<br /> -------------------------------------</p></div> Thu, 14 Aug 2014 04:01:57 +0000 mikekaganski comment 64722 at https://www.ejabberd.im