diff --git a/source/org/jivesoftware/smack/SASLAuthentication.java b/source/org/jivesoftware/smack/SASLAuthentication.java index 2f6304ae4..45eedd8cf 100644 --- a/source/org/jivesoftware/smack/SASLAuthentication.java +++ b/source/org/jivesoftware/smack/SASLAuthentication.java @@ -188,8 +188,10 @@ public class SASLAuthentication implements UserAuthentication { Constructor constructor = selected .getConstructor(new Class[]{SASLAuthentication.class}); currentMechanism = (SASLMechanism) constructor.newInstance(new Object[]{this}); - // Trigger SASL authentication with the selected mechanism - currentMechanism.authenticate(username, connection.getServiceName(), password); + // Trigger SASL authentication with the selected mechanism. We use + // connection.getHost() since GSAPI requires the FQDN of the server, which + // may not match the XMPP domain. + currentMechanism.authenticate(username, connection.getHost(), password); // Wait until SASL negotiation finishes synchronized (this) { diff --git a/source/org/jivesoftware/smack/sasl/SASLMechanism.java b/source/org/jivesoftware/smack/sasl/SASLMechanism.java index d6a70a0a0..adf7e7a06 100644 --- a/source/org/jivesoftware/smack/sasl/SASLMechanism.java +++ b/source/org/jivesoftware/smack/sasl/SASLMechanism.java @@ -73,6 +73,7 @@ public abstract class SASLMechanism { * response to the server's challenge. * * @param challenge a base64 encoded string representing the challenge. + * @throws IOException if an exception sending the response occurs. */ public void challengeReceived(String challenge) throws IOException { // Build the challenge response stanza encoding the response text