ejabberd - Comments for "Hot wo setup mod_shared_roosters_ldap? " https://www.ejabberd.im/node/22849 en Thanks for the answers, as https://www.ejabberd.im/node/22849#comment-64857 <p>Thanks for the answers, as soon as I'll have time to try this out, I'll reply. Actual trying some alternatives.</p> Wed, 20 Aug 2014 11:06:38 +0000 Yaerox comment 64857 at https://www.ejabberd.im Yaerox wrote: That's exactly https://www.ejabberd.im/node/22849#comment-64836 <div class="quote-msg"> <div class="quote-author"><em>Yaerox</em> wrote:</div> <p>That's exactly what I need to do too, but my research couldn't help me finding a solution.</p> <p>I'm not even as far as you're :/ If you would be so kind, could u help me out to get as far as you are?</p></div> <p>Those might also help you: </p> <p><noindex><a href="http://www.process-one.net/docs/ejabberd/guide_en.html#modsharedrosterldap" title="http://www.process-one.net/docs/ejabberd/guide_en.html#modsharedrosterldap" rel="nofollow" >http://www.process-one.net/docs/ejabberd/guide_en.html#modsharedrosterldap</a></noindex></p> <p><a href="http://www.ejabberd.im/node/4722" title="http://www.ejabberd.im/node/4722">http://www.ejabberd.im/node/4722</a></p> <p>Is that your whole configuration ? Since i don't see any LDAP Binding ...</p> <p>Well i consider you left that part out ...<br /> I think your problem is that your ldap filters are strange :)</p> <p>Your ldap configuration should look something like this:</p> <p>{auth_method, ldap}.<br /> {ldap_servers, ["server.domain.com"]}.<br /> {ldap_uids, [{"sAMAccountName"}]}.<br /> {ldap_encrypt, tls}.<br /> {ldap_tls_verify, false}. %% for debbugging reasons its easy :P<br /> {ldap_port, 636}.<br /> {ldap_base, "DC=server,DC=com"}.<br /> {ldap_rootdn, "CN=ldapauth,OU=users,DC=domain,DC=com"}.<br /> {ldap_password, "*******"}.<br /> {ldap_filter, "(objectClass=*)"}.</p> <p>{mod_shared_roster_ldap, [<br /> {ldap_base, "ou=ejabberd,ou=Groups,dc=domain,dc=com"},<br /> {ldap_groupattr, "cn"},<br /> {ldap_groupdesc, "description"},<br /> {ldap_memberattr, "member"},<br /> {ldap_memberattr_format, "CN=%u,OU=Users,DC=domain,DC=com"},<br /> {ldap_useruid, "cn"},<br /> {ldap_userdesc, "displayName"},<br /> {ldap_rfilter, "(objectClass=group)"},<br /> {ldap_gfilter, "(cn=%g)"},<br /> {ldap_ufilter, "(cn=%u)"},<br /> {ldap_filter, ""},<br /> ]}, </p> <p>I hope this helps you :)</p> Tue, 19 Aug 2014 08:06:00 +0000 voest comment 64836 at https://www.ejabberd.im I'm trying for hours...I read https://www.ejabberd.im/node/22849#comment-64773 <p>I'm trying for hours...I read my local documentation which seems different from the actual online version, I tried this the same way they do:</p> <blockquote><p> This however seems to be a common DIT layout, so the module keeps supporting it. You can use the following configuration…</p> <p>modules:<br /> ...<br /> mod_shared_roster_ldap:<br /> ldap_base: "ou=flat,dc=nodomain"<br /> ldap_rfilter: "(objectClass=inetOrgPerson)"<br /> ldap_groupattr: "ou"<br /> ldap_memberattr: "cn"<br /> ldap_filter: "(objectClass=inetOrgPerson)"<br /> ldap_userdesc: "displayName"<br /> ...</p> <p>…to be provided with a roster as shown in figure 3.2 upon connecting as user czesio. </p></blockquote> <p>My config looked like:</p> <blockquote><p> mod_shared_roster_ldap: {<br /> ldap_base: "ou=Benutzer,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de",<br /> ldap_rfilter: "(objectClass=user)",<br /> ldap_groupattr: "ou",<br /> ldap_memberattr: "cn",<br /> ldap_filter: "(objectClass=user)",<br /> ldap_userdesc: "displayName"<br /> } </p></blockquote> <p>nothing is happening. Log says stuff like this ... : </p> <blockquote><p> 2014-08-15 16:06:43.884 [debug] &lt;0.1947.0&gt;@ejabberd_local:do_route:296 local route<br /> from {jid,&lt;&lt;"MYUSERNAME"&gt;&gt;,&lt;&lt;"DOMAIN.de"&gt;&gt;,&lt;&lt;"IP_ADRESS_MY_PC"&gt;&gt;,&lt;&lt;"MYUSERNAME"&gt;&gt;,&lt;&lt;"DOMAIN.de"&gt;&gt;,&lt;&lt;"IP_ADRESS_MY_PC"&gt;&gt;}<br /> to {jid,&lt;&lt;"MYUSERNAME"&gt;&gt;,&lt;&lt;"DOMAIN.de"&gt;&gt;,&lt;&lt;&gt;&gt;,&lt;&lt;"MYUSERNAME"&gt;&gt;,&lt;&lt;"DOMAIN.de"&gt;&gt;,&lt;&lt;&gt;&gt;}<br /> packet {xmlel,&lt;&lt;"iq"&gt;&gt;,[{&lt;&lt;"xml:lang"&gt;&gt;,&lt;&lt;"de"&gt;&gt;},{&lt;&lt;"type"&gt;&gt;,&lt;&lt;...&gt;&gt;},{&lt;&lt;...&gt;&gt;,...}],[{xmlcdata,&lt;&lt;...&gt;&gt;},{xmlel,...},{...}]} </p></blockquote> <p>For me this looks like the result is empty.</p> <p>Maybe another example explained how I get to my configs:</p> <blockquote><p> mod_shared_roster_ldap: {<br /> ldap_base: "ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de", ## Start search here ...<br /> ldap_rfilter: "(&amp;(objectClass=organizationalUnit)(distinguishedName=ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de))", ## Looking for an OU called "Users" in the ldap_base ...<br /> ldap_filter: "", ## this is always empty, I didn't understood why ...</p> <p> ldap_groupattr: "distinguishedName", ## This is what the rfilter will return.</p> <p> ## ----------------------------------<br /> ## Result: Name | Value | &gt; DN<br /> ## OU | Users | ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ##<br /> ## So I guess ldap_groupattr-&gt;distinguishedName is equal Users now<br /> ## ==&gt; %g = Users<br /> ## ----------------------------------</p> <p> ldap_gfilter: "(&amp;(objectClass=user)(memberOf=CN=MYGROUP,OU=Groups,OU=DOMAIN1/DOMAIN2,DC=DOMAIN1,DC=DOMAIN2,DC=de))", ## Looking for Users who are memberOf MYGROUP..</p> <p> ldap_groupdesc: "displayName",<br /> ldap_memberattr: "cn",</p> <p> ## ----------------------------------<br /> ## Result: Name | Value | &gt; DN<br /> ## CN | User001 | ou=Test,ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ## CN | User002 | ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ## CN | User003 | ou=Test,ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ## CN | User004 | ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ##<br /> ## So I guess ldap_groupattr-&gt;distinguishedName, ldap_groupdesc-&gt;displayName and ldap_memberattr-&gt;cn is now running in a loop and changing it's value 4 times.<br /> ## #1 ldap_groupattr-&gt;distinguishedName = cn=User001,ou=Test,ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ## #1 ldap_groupdesc-&gt;displayName = Users_Firstname Users_Lastname<br /> ## #1 ldap_memberattr-&gt;cn = User001<br /> ##<br /> ## #2 ldap_groupattr-&gt;distinguishedName = cn=User002,ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ## #2 ldap_groupdesc-&gt;displayName = Users_Firstname Users_Lastname<br /> ## #2 ldap_memberattr-&gt;cn = User002<br /> ##<br /> ## #3 ldap_groupattr-&gt;distinguishedName = cn=User003,ou=Test,ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ## #3 ldap_groupdesc-&gt;displayName = Users_Firstname Users_Lastname<br /> ## #3 ldap_memberattr-&gt;cn = User003<br /> ##<br /> ## #4 ldap_groupattr-&gt;distinguishedName = cn=User004,ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ## #4 ldap_groupdesc-&gt;displayName = Users_Firstname Users_Lastname<br /> ## #4 ldap_memberattr-&gt;cn = User004<br /> ##<br /> ## So I guess ldap_groupdesc-&gt;displayName is: ==&gt; %u = Users_Firstname Users_Lastname<br /> ## ----------------------------------</p> <p> ldap_memberattr_format: "cn=%u,ou=Users,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de"</p> <p> ldap_ufilter: "(&amp;(objectClass=user)(memberOf=CN=MYGROUP,OU=Groups,OU=DOMAIN1/DOMAIN2,DC=DOMAIN1,DC=DOMAIN2,DC=de)(distinguishedName=%g))",</p> <p> ## ----------------------------------<br /> ## Result: Name | Value | &gt; DN<br /> ## CN | User001 | ou=Test,ou=DOMAIN1/DOMAIN2,dc=DOMAIN1,dc=DOMAIN2,dc=de<br /> ##<br /> ## So I guess ldap_userdesc-&gt;cn: ==&gt; %u = User001<br /> ## ----------------------------------</p> <p> ldap_userdesc: "cn"<br /> } </p></blockquote> <p>Do I understand this right? Because it is still nothing happening with this latest configurations ... please help me out.</p> Fri, 15 Aug 2014 14:46:31 +0000 Yaerox comment 64773 at https://www.ejabberd.im Edited first post. https://www.ejabberd.im/node/22849#comment-64730 <p>Edited first post.</p> Fri, 15 Aug 2014 09:20:34 +0000 Yaerox comment 64730 at https://www.ejabberd.im @YAerox: So I am not so https://www.ejabberd.im/node/22849#comment-64741 <p>@YAerox:<br /> So I am not so familiar with ejabberd-14.07, but setting aside the formatting differences from 2.1, you are trying the webadmin access -- have you set your ldap account as an administrator?</p> <blockquote><p> %% Admin user<br /> {acl, admin, {user, "MyUsername", "DOMAIN1.DOMAIN2.com"}}. </p></blockquote> <p><em>change the domain name to whatever you use</em></p> <p>I think that input represents the only users that are allowed to log into webadmin.</p> <p>My next suggestion is to relegate the <code>ldap_servers</code> to a single server for now. I am less familiar with multiple servers.</p> Thu, 14 Aug 2014 16:17:18 +0000 bedfordr comment 64741 at https://www.ejabberd.im