AnsweredAssumed Answered

PacketParserUtils.parseSASLFailure throws an exception if there is a 'text' element inside the 'failure'

Question asked by Igor Khomenko on Dec 11, 2014
Latest reply on Dec 11, 2014 by Igor Khomenko

According to XMPP doc it's possible to have the OPTIONAL descriptive text in inside 'failure' element

http://xmpp.org/rfcs/rfc6120.html#sasl-errors

 

but smack throws an exception

 

for example, here is an example of 'failure' which causes an exception in asmack

D/SMACK﹕ RCV (0): <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/><text xml:lang='en'>Password not verified</text></failure>

 

12-11 12:37:06.311    1709-1856/com.ben.snippets W/SASLError﹕ Could not transform string 'text' to SASLError

    java.lang.IllegalArgumentException: text is not a constant in org.jivesoftware.smack.sasl.SASLError

            at java.lang.Enum.valueOf(Enum.java:198)

            at org.jivesoftware.smack.sasl.SASLError.valueOf(SASLError.java:22)

            at org.jivesoftware.smack.sasl.SASLError.fromString(SASLError.java:48)

            at org.jivesoftware.smack.sasl.SASLMechanism$SASLFailure.<init>(SASLMechanism.java :357)

            at org.jivesoftware.smack.util.PacketParserUtils.parseSASLFailure(PacketParserUtil s.java:720)

            at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:255)

            at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:49)

            at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:83)

 

I use asmack 4.0.6

Outcomes