[JDEV] Some more :)

Schuyler Heath sheath at jabber.org
Wed Nov 29 06:40:02 CST 2000


Hello,

On Wed, Nov 29, 2000 at 02:39:41PM +0200, Dennis Noordsij wrote:
> Hi,
> 
> Yes, that is how it works. First Gabber sends a login request with a digest, 
> which I reject. Then it sends one with the plaintext password, I check it 
> with the LDAP database and send either a right or wrong reply. Gabber is now 
> succesfully logged in via LDAP. Mission accomplished :-) 20 lines of Perl or 
> so.
> 
> Next mission, retrieve a roster based on LDAP. 20 lines of Perl again, only 
> one problem - how do I tell jabber to send jabber:iq:roster packets to my 
> module?
> 
> I used the exact same approach, create a service id = rostermod, connect to 
> it via <accept>, etc.

Storing and retrieving rosters, vcard, etc. is done with a xdb component
like you did originally.

<xdb id="xdbperl">
  <ns>jabber:iq:roster</ns>
  <host>localhost</host>
  <accept>
    ...
  </accept>
</xdb>

You will receive xdb packet in this form:

<xdb type="set" to="user1 at localhost/jabber:iq:roster" from="localhost">
  <query xmlns='jabber:iq:roster'>
    ...
  </query>
</xdb>

or

<xdb type="get" to="user1 at localhost/jabber:iq:roster" from="localhost id='8'"/>

For a successful set request simply send back this:

<xdb type="result" from="user1 at localhost/jabber:iq:roster" to="localhost"/>

Get requests will contain the requested data in the result:

<xdb type='result' from="user1 at localhost/jabber:iq:roster" to="localhost" id='8'>
  <query xmlns='jabber:iq:roster'>
    <item jid='something' subscription='both'/>
  </query>
</xdb>

If an error occurs you don't send anything back.  It is the responsibility of the
client to timeout xdb requests.

Schuyler

> With the authorization script I defined  <auth>perlauth</auth> in jabber.xml
> 
> What do I define in jabber.xml do send roster requests to this service?
> 
> 
> Regards,
> Dennis
> 
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev




More information about the JDev mailing list