diff --git a/source/org/jivesoftware/smack/sasl/SASLAnonymous.java b/source/org/jivesoftware/smack/sasl/SASLAnonymous.java index 9423bedc8..598d02f24 100644 --- a/source/org/jivesoftware/smack/sasl/SASLAnonymous.java +++ b/source/org/jivesoftware/smack/sasl/SASLAnonymous.java @@ -48,24 +48,14 @@ public class SASLAnonymous extends SASLMechanism { } protected void authenticate() throws IOException { - StringBuilder stanza = new StringBuilder(); - stanza.append(""); - stanza.append(""); - // Send the authentication to the server - getSASLAuthentication().send(stanza.toString()); + getSASLAuthentication().send(new AuthMechanism(getName(), null)); } public void challengeReceived(String challenge) throws IOException { // Build the challenge response stanza encoding the response text - StringBuilder stanza = new StringBuilder(); - stanza.append(""); - stanza.append("="); - stanza.append(""); - - // Send the authentication to the server - getSASLAuthentication().send(stanza.toString()); + // and send the authentication to the server + getSASLAuthentication().send(new Response()); }