From 2c93fc9e70a5f5afe90e9ba64dfff6889de20247 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Fri, 24 Oct 2008 03:54:21 +0000 Subject: [PATCH] Use XMPP domain (and not hostname) for SASL. Confirm with Jay that we are not breaking other SASL mechanisms (DIGEST-MD5 works now) git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10844 b35dd754-fafc-0310-a699-88a17e54d16e --- .../org/jivesoftware/smack/SASLAuthentication.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/source/org/jivesoftware/smack/SASLAuthentication.java b/source/org/jivesoftware/smack/SASLAuthentication.java index 0a9da9ae4..516e874ab 100644 --- a/source/org/jivesoftware/smack/SASLAuthentication.java +++ b/source/org/jivesoftware/smack/SASLAuthentication.java @@ -24,17 +24,11 @@ import org.jivesoftware.smack.filter.PacketIDFilter; import org.jivesoftware.smack.packet.Bind; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.Session; -import org.jivesoftware.smack.sasl.SASLMechanism; -import org.jivesoftware.smack.sasl.SASLAnonymous; -import org.jivesoftware.smack.sasl.SASLPlainMechanism; -import org.jivesoftware.smack.sasl.SASLCramMD5Mechanism; -import org.jivesoftware.smack.sasl.SASLDigestMD5Mechanism; -import org.jivesoftware.smack.sasl.SASLExternalMechanism; -import org.jivesoftware.smack.sasl.SASLGSSAPIMechanism; +import org.jivesoftware.smack.sasl.*; +import javax.security.auth.callback.CallbackHandler; import java.io.IOException; import java.lang.reflect.Constructor; -import javax.security.auth.callback.CallbackHandler; import java.util.*; /** @@ -311,7 +305,7 @@ public class SASLAuthentication implements UserAuthentication { // 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); + currentMechanism.authenticate(username, connection.getServiceName(), password); // Wait until SASL negotiation finishes synchronized (this) {