Xmpp/Jabberd Ldap Authentication
From Debuntu
Get both Jabber::Connection from CPAN and xdb_auth_cpile.
Contents |
Setting jabber.xml
In /etc/jabber/jabber.xml, add:
<ns/>
to the <xdb id="xdb"> section.
Then, just below, add:
<xdb id="xdb_auth_cpile">
<host/>
<ns>jabber:iq:auth</ns>
<accept>
<ip>127.0.0.1</ip>
<port>5999</port>
<secret>testing</secret>
</accept>
</xdb>
Mind that you might want to change the port number and secret.
Disable digest authentication so the xdb_cauth_pile get plain password passed to it. Mind that this should be only used internally, you dont want password to go on your network plain, do you?:
<!--<mod_auth_digest>./jsm/jsm.so</mod_auth_digest>-->
xdb_auth_cpile
Setting xdb_auth_cpile
Then, create a file /etc/jabber/xdb_auth_cpile.xml containing the configuration for xdb_auth_cpile.pl:
<config>
<script>
<logfile>./xdb_auth.log</logfile>
<pidfile>./xdb_auth.pid</pidfile>
<!-- debug can be "1" or "0" (on/off) -->
<debug>0</debug>
</script>
<connection>
<!-- make sure these values match those in your jabber.xml config -->
<id>xdb_auth_cpile</id>
<ip>127.0.0.1</ip>
<port>5999</port>
<secret>testing</secret>
</connection>
</config>
This file has to use the same host, port and secret value as define in jabber.xml.
- Copy from the archive xdb_auth_cpile.pm.ldap to /etc/jabber/. If you want to use STARTTLS, please use media:xdb_auth_cpile.pm.ldap.pm and edit the setting to match your server's.
- Optionally, test your LDAP connection settings with: media:test_xdb_auth_cpile.pl.txt.
- Copy xdb_auth_cpile.pl and edit the use lib and my $configdir lines to look like:
- use lib qw(/etc/jabber/);
- ...
- my $configdir = "/etc/jabber/";
Installing Jabber::Connection
Make sure that perl's LDAP and optionally SSL libraries are installed:
# apt-get install libnet-ldap-perl libio-socket-ssl-perl
then install Jabber::Connection
From CPAN
Install the CPAN module by using this command:
# perl -MCPAN -e 'install Jabber::Connection'
From source
If you are installing Jabber::Connection from the .tar.gz, you need to proceed as follow:
tar -xzvf Jabber-Connection-0.04.tar.gz cd Jabber-Connection-0.04 perl Makefile.PL make make test make install
Using it
Finally, to use it, start up jabber and run: