[ejabberd] extauth question

Leif Johansson leifj at it.su.se
Tue May 31 02:04:57 MSD 2005


On Mondayen den 30 May 2005 23.32, Felipe Brito Vasconcellos wrote:
> Hello. I use the extauth successfully here. But I want to improve it.
>
> So, I need to know what kind of data ejabberd expects to receive as
> confirmation or not of the auth process.
>
> I use the check_pass.... example script together with a C program that
> connects to my ldap server. I do this because I was unable to return the
> right data to ejabberd. I tried to return string OK and integer 1 as
> success and string ERR and integer 0 to fail.
>
> Can someone explain to me the data ejabberd expects to receive after a
> login process?

The protocol between the external authentication handler in ejabberd and
the external authentication script is a binary protocol. The requests is on
the form

<short in network order> <bytes>

To decode memcpy and n2hs the short, next read this many bytes from
the stream. This string has the following syntax:

<operation> ':' <user> ':' <domain> ':' <password>

The return packet must be encoded as

<2><0|1>

I.e the number 2 as a short encoded in network order followed by a 
short containing 0 or 1 (again a short in network order).

	Cheers Leif 


More information about the ejabberd mailing list