XMPPConnection connection;
SASLAuthentication auth;
public void login(String userName, String password) throws XMPPException
{
ConnectionConfiguration config = new ConnectionConfiguration("testjabber",5222, "Work");
connection = new XMPPConnection(config);
connection.connect();
System.out.println(SASLAuthentication.getRegisterSASLMechanisms());
connection.login(userName,"");
}
I think the Problem is, he dont use the GSSAPI mechanism. He only use the PLAIN method:
[class org.jivesoftware.smack.sasl.SASLGSSAPIMechanism, class org.jivesoftware.smack.sasl.SASLDigestMD5Mechanism, class org.jivesoftware.smack.sasl.SASLCramMD5Mechanism, class org.jivesoftware.smack.sasl.SASLPlainMechanism, class org.jivesoftware.smack.sasl.SASLAnonymous]
Exception in thread "main" SASL authentication failed using mechanism PLAIN:
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:325)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349)
at JabberSmackAPI.login(JabberSmackAPI.java:25)
at JabberSmackAPI.main(JabberSmackAPI.java:70)
but i dont know why?