1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Remove non-SASL authentication code (SMACK-446)

This commit is contained in:
Florian Schmaus 2014-02-26 21:57:42 +01:00
parent 3a4e6c6d39
commit 790343867a
8 changed files with 18 additions and 284 deletions

View file

@ -37,14 +37,12 @@ public class BOSHConfiguration extends ConnectionConfiguration {
public BOSHConfiguration(String xmppDomain) {
super(xmppDomain, 7070);
setSASLAuthenticationEnabled(true);
ssl = false;
file = "/http-bind/";
}
public BOSHConfiguration(String xmppDomain, int port) {
super(xmppDomain, port);
setSASLAuthenticationEnabled(true);
ssl = false;
file = "/http-bind/";
}
@ -65,7 +63,6 @@ public class BOSHConfiguration extends ConnectionConfiguration {
*/
public BOSHConfiguration(boolean https, String host, int port, String filePath, String xmppDomain) {
super(host, port, xmppDomain);
setSASLAuthenticationEnabled(true);
ssl = https;
file = (filePath != null ? filePath : "/");
}
@ -87,7 +84,6 @@ public class BOSHConfiguration extends ConnectionConfiguration {
*/
public BOSHConfiguration(boolean https, String host, int port, String filePath, ProxyInfo proxy, String xmppDomain) {
super(host, port, xmppDomain, proxy);
setSASLAuthenticationEnabled(true);
ssl = https;
file = (filePath != null ? filePath : "/");
}

View file

@ -308,8 +308,7 @@ public class BOSHConnection extends Connection {
username = username.toLowerCase().trim();
String response;
if (config.isSASLAuthenticationEnabled()
&& saslAuthentication.hasNonAnonymousAuthentication()) {
if (saslAuthentication.hasNonAnonymousAuthentication()) {
// Authenticate using SASL
if (password != null) {
response = saslAuthentication.authenticate(username, password, resource);
@ -317,8 +316,7 @@ public class BOSHConnection extends Connection {
response = saslAuthentication.authenticate(username, resource, config.getCallbackHandler());
}
} else {
// Authenticate using Non-SASL
response = new NonSASLAuthentication(this).authenticate(username, password, resource);
throw new XMPPException("No non-anonymous SASL authentication mechanism available");
}
// Set the user.
@ -370,13 +368,12 @@ public class BOSHConnection extends Connection {
}
String response;
if (config.isSASLAuthenticationEnabled() &&
saslAuthentication.hasAnonymousAuthentication()) {
if (saslAuthentication.hasAnonymousAuthentication()) {
response = saslAuthentication.authenticateAnonymously();
}
else {
// Authenticate using Non-SASL
response = new NonSASLAuthentication(this).authenticateAnonymously();
throw new XMPPException("No anonymous SASL authentication mechanism available");
}
// Set the user value.