Connection connection = new XMPPConnection("jabber.org");
connection.connect();
connection.login("username", "password");
但我什至无法通过登录部分。当我运行上面的代码时,我得到这个异常:
Exception in thread "main" SASL authentication DIGEST-MD5 failed: invalid-authzid:
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:337)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
at org.jivesoftware.smack.Connection.login(Connection.java:348)
at com.smack.TestSmack.main(TestSmack.java:19)