ejabberd - Comments for "virtual hosting + jids from ldap"
https://www.ejabberd.im/node/923
enHere's a patch to do that
https://www.ejabberd.im/node/923#comment-1969
<p>I found a way to do what we want, but it required modifying the ejabberd_auth_ldap module. This patch hard-codes the userid part of the DN to be "userid@server" before sending to to LDAP for a match. This code works for me, but of course your mileage may vary.</p>
<p>I'm working on a better version of this that will allow a configuration option in ejabberd.cfg which I'll submit to the ejabberd maintainers.<br />
----------- SNIP</p>
<pre>--- ejabberd-1.1.1/src/ejabberd_auth_ldap.erl.orig 2006-02-27 10:09:07.000000000 -0500
+++ ejabberd-1.1.1/src/ejabberd_auth_ldap.erl 2006-07-04 16:59:46.000000000 -0400
@@ -132,7 +132,7 @@
find_user_dn(User, Server) ->
LServer = jlib:nameprep(Server),
Attr = ejabberd_config:get_local_option({ldap_uidattr, LServer}),
- Filter = eldap:equalityMatch(Attr, User),
+ Filter = eldap:equalityMatch(Attr, lists:append([User, [64], Server])),
Base = ejabberd_config:get_local_option({ldap_base, LServer}),
case eldap:search(get_eldap_id(LServer, ejabberd),
[{base, Base},</pre><p>-----------SNIP</p>
<p>This literally appends "@" and the Virtual Host domain to the User ID (node) part of the JID.</p>
<p>/BAK/<br />
--<br />
Ben Klang<br />
<noindex><a href="mailto:bklang@alkaloid.net" rel="nofollow" >bklang@alkaloid.net</a></noindex><br />
404.475.4850<br />
<noindex><a href="http://projects.alkaloid.net" title="http://projects.alkaloid.net" rel="nofollow" >http://projects.alkaloid.net</a></noindex></p>
Tue, 04 Jul 2006 22:05:08 +0000bklangcomment 1969 at https://www.ejabberd.imI need this as well
https://www.ejabberd.im/node/923#comment-1968
<p>I also want to clarify that I'm looking to host each realm locally. That means that the virtual host for xyz.com and abc.com will both be configured. I'm *not* trying to create JIDs like (user@abc.com@xyz.com).</p>
<p>I have so far been unable to find a way to do this with ejabberd but I'm still looking. Any suggestions or pointers are welcome.</p>
<p>/BAK/<br />
--<br />
Ben Klang<br />
<noindex><a href="mailto:bklang@alkaloid.net" rel="nofollow" >bklang@alkaloid.net</a></noindex><br />
404.475.4850<br />
<noindex><a href="http://projects.alkaloid.net" title="http://projects.alkaloid.net" rel="nofollow" >http://projects.alkaloid.net</a></noindex></p>
Tue, 04 Jul 2006 18:15:28 +0000bklangcomment 1968 at https://www.ejabberd.im