mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Remove non-SASL authentication code (SMACK-446)
This commit is contained in:
parent
3a4e6c6d39
commit
790343867a
8 changed files with 18 additions and 284 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue