I want to develop a Java application that connects to Google Talk and allows the user to chat with friends. I use smack API and code:
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com",5222,"gmail.com"); SASLAuthentication.supportSASLMechanism("PLAIN", 0); XMPPConnection connection = new XMPPConnection(config); try { connection.connect(); } catch (XMPPException e) { e.printStackTrace(); } try { connection.login("username", "password"); } catch (XMPPException e) { e.printStackTrace(); }
but I get the following exception:
SASL authentication PLAIN 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 Main.main(Main.java:21)
Can someone help me solve this problem?
source share