mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-1747: No SSO? Ignore GSSAPI mech
When Spark is not logging in with SSO, don't consider the GSSAPI mechanism if offered by the server.
This commit is contained in:
@ -31,6 +31,7 @@ import org.jivesoftware.smack.*;
|
|||||||
import org.jivesoftware.smack.parsing.ExceptionLoggingCallback;
|
import org.jivesoftware.smack.parsing.ExceptionLoggingCallback;
|
||||||
import org.jivesoftware.smack.proxy.ProxyInfo;
|
import org.jivesoftware.smack.proxy.ProxyInfo;
|
||||||
import org.jivesoftware.smack.sasl.javax.SASLExternalMechanism;
|
import org.jivesoftware.smack.sasl.javax.SASLExternalMechanism;
|
||||||
|
import org.jivesoftware.smack.sasl.javax.SASLGSSAPIMechanism;
|
||||||
import org.jivesoftware.smack.tcp.XMPPTCPConnection;
|
import org.jivesoftware.smack.tcp.XMPPTCPConnection;
|
||||||
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
|
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
|
||||||
import org.jivesoftware.smack.util.TLSUtils;
|
import org.jivesoftware.smack.util.TLSUtils;
|
||||||
@ -292,6 +293,16 @@ public class LoginDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SPARK-1747: Don't use the GSSAPI mechanism when SSO is disabled.
|
||||||
|
if ( localPref.isSSOEnabled() && !SASLAuthentication.getRegisterdSASLMechanisms().containsKey( SASLGSSAPIMechanism.class.getName() ))
|
||||||
|
{
|
||||||
|
SASLAuthentication.registerSASLMechanism( new SASLGSSAPIMechanism() );
|
||||||
|
}
|
||||||
|
else if ( !localPref.isSSOEnabled() && SASLAuthentication.getRegisterdSASLMechanisms().containsValue( SASLGSSAPIMechanism.NAME ))
|
||||||
|
{
|
||||||
|
SASLAuthentication.unregisterSASLMechanism( SASLGSSAPIMechanism.class.getName() );
|
||||||
|
}
|
||||||
|
|
||||||
ReconnectionManager.setEnabledPerDefault( true );
|
ReconnectionManager.setEnabledPerDefault( true );
|
||||||
|
|
||||||
// TODO These were used in Smack 3. Find Smack 4 alternative.
|
// TODO These were used in Smack 3. Find Smack 4 alternative.
|
||||||
|
|||||||
Reference in New Issue
Block a user