I am developing on Ubuntu. I am trying to connect my xmpp client to local openfire server.
AndroidConnectionConfiguration configuration = new AndroidConnectionConfiguration(
host, Integer.parseInt(port), service);
SASLAuthentication.supportSASLMechanism("PLAIN", 0); // (I tried after removing this line)
configuration.setSASLAuthenticationEnabled(true);
configuration.setDebuggerEnabled(true);
XMPPConnection connection = new XMPPConnection(configuration);
try {
connection.connect();
Log.i("XMPPClient",
"[SettingsDialog] Connected to " + connection.getHost());
} catch (XMPPException ex) {
Log.e("XMPPClient", "[SettingsDialog] Failed to connect to "
+ connection.getHost());
Log.e("XMPPClient", ex.toString());
xmppClient.setConnection(null);
}
try {
connection.login(username, password);
Log.i("XMPPClient", "Logged in as " + connection.getUser());
// Set the status to available
Presence presence = new Presence(Presence.Type.available);
connection.sendPacket(presence);
xmppClient.setConnection(connection);
} catch (XMPPException ex) {
Log.e("XMPPClient", "[SettingsDialog] Failed to log in as "
+ username);
Log.e("XMPPClient", ex.toString());
xmppClient.setConnection(null);
}
Now I can connect with Google chat server with this code. Also I can connect local server with Spark client on Ubuntu. But fails to connect with local server on Android.
Where host as 10.0.2.2 ( Android localhost) port 5222 service localhost
Android client can successfully connect with the local server but I can't login
The error I am getting sasl authentication failed using mechanism digest-md5
I am searching for past two days and tried so many things but no success with local server.