XML::Stream: Read: buff(<?xml version='1.0'?><stream:stream version='1.0' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' id='***uuid***' from='jabber.de'><stream:features><register xmlns='http://jabber.org/features/iq-register'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>SCRAM-SHA-1</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>)
[...]
XMPP::Conn: AuthSASL: shiney new auth
XML::Stream: Send: (<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1 PLAIN'>***credentials***</auth>)
XMPP::Conn: AuthSASL: haven't authed yet... let's wait.
XMPP::Conn: Process: timeout(1)
XML::Stream: Read: buff(<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><invalid-mechanism/></failure>)
Problem
SASL authentication fails when both server and client support more than 1 SASL mechanism.
Environment to reproduce the bug
libauthen-sasl-cyrus-perlActual version was
0.13-server-10+b5Actual server was
jabber.desupportingPLAINandSCRAM-SHA-1Cause
mechanism='SCRAM-SHA-1 PLAIN'in the client request. It should not contain both supported mechanisms.libauthen-sasl-cyrus-perl- which effectively means removing support forSCRAM-SHA-1on the client side - fixes the problem:The same line can be found in Net/XMPP/Protocol.pm.
Related issues