Google トークに接続して、ユーザーが友達とチャットできるようにする Java アプリケーションを開発したいと考えています。私はsmack APIと以下のコードを使用しています:
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();
}
しかし、私は以下の例外を取得します:
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)
誰かがこの問題を解決するのを手伝ってくれますか?