jaxl / JAXL

Asynchronous, non-blocking I/O, event based PHP library for writing custom TCP/IP client and server implementations. From it's previous versions, library inherits a full blown stable support for XMPP protocol stack. In v3.0, support for HTTP protocol stack was also added.
http://jaxl.readthedocs.org/
Other
379 stars 121 forks source link

Prosody 0.10 does not allow client@server.com JID format #94

Open uncovery opened 7 years ago

uncovery commented 7 years ago

When you connect to prosody 0.10, you cannot use

$client = new JAXL(array(
        'jid' => 'username@server.com',
        'pass' => 'my_password',
    ));

You need to change it to this format:

$client = new JAXL(array(
        'jid' => 'username',
        'host' => 'server.com',
        'pass' => 'my_password',
    ));

the examples in the documentation should be updated accordingly.

horazont commented 7 years ago

FWIW, I was looking into the issue in the prosody MUC. This is what we saw. JAXL would send as "simple user name" (cf. RFC 6120, Section 6.3.7) the full bare JID instead of only the localpart. While this appears to have worked in the past, it doesn't anymore.

The root cause is https://github.com/jaxl/JAXL/blob/27aa43c4600b05809779428843d8d51db6ce6e0d/src/JAXL/jaxl.php#L685 I think. There one should only pass the localpart of the JID instead of the full bare JID.

Given that JAXL probably cannot generally assume "deployment specific information" which allows to use the full bare JID as simple user name, this appears to be a violation of a SHOULD in RFC 6120:

However, in the absence of local information provided by the server, an XMPP client SHOULD assume that the authentication identity for such a SASL mechanism is a simple user name equal to the localpart of the user's JID.

Disclaimer: I looked at the JAXL source code for like, maybe, 5 minutes or so; aside from that, I only looked at the debug trace @uncovery gave.