[JDEV] Question...
Schuyler Heath
sheath at jabber.org
Mon Nov 27 08:35:17 CST 2000
Hello,
auth components are not written as xdb components, they are services or jsm
modules.
Here is what the configuration could look like:
<service id="perlauth">
<accept>
<ip>127.0.0.1</ip>
<port>2233</ip>
<secret>secret</secret>
</accept>
</service>
There is no need to have a <host/>, auth packets will be routed to your component
with the id. You will also need to add this to your jsm config.
<service id="sessions">
...
<jsm xmlns="jabber:jsm:config">
..
<auth>perlauth</auth>
</jsm>
</service>
You then will receive the following when a user attempts to authenticate:
<route type='auth' from='2 at jpolld.localhost/134566776' to='perlauth' oto='test at localhost'>
<iq type='set' id='0'>
<query xmlns='jabber:iq:auth'>
<username>test</username>
<password>foo</password>
<resource>home</resource>
</query>
</iq>
</route>
A successful result would look like this:
<route type='auth' to='2 at jpolld.localhost/134566776' from='perlauth' oto='test at localhost'>
<iq type="result" id="0"/>
</route>
Schuyler
On Mon, Nov 27, 2000 at 06:35:58PM +0200, Dennis Noordsij wrote:
> Hi,
>
> I am a little stuck here :-)
>
> I am trying to write a custom xdb auth module in Perl, and have it connect to
> jabber via <accept>
>
> My jabber.xml section:
>
> <xdb id="auth.mydomain">
> <ns>jabber:iq:auth</ns>
> <host/>
> <accept>
> <ip>127.0.0.1</ip>
> <port>2233</ip>
> <secret>secret</secret>
> </accept>
> </xdb>
>
> I then write a small Perl script using Net::Jabber, connect to the Jabber
> server using Net::Jabber::Component (which works, jabberd also reports the
> connection, and from now on xdb requests are -according to jabberd -D output-
> sent to both xdb_file and my auth.mydomain module.
>
> I have registered an xdb callback in my perl script, and I do get an xdb
> packet when I expect one (ie when someone logs in), but it is simply <xdb/>
> .. no other information.
>
> Is it because I am also still using xdb_file ?
>
> Gotta go now, but looking forward to any suggestions!!
>
> Kind regards,
> Dennis
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
More information about the JDev
mailing list