我正在尝试通过 XMPP 服务器使用 SMACK API 连接到 gmail。但得到
错误:使用机制 PLAIN 的 SASL 身份验证失败
你可以检查一下代码。我只从网上得到
ConnectionConfiguration connConfig = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
connection = new XMPPConnection(connConfig);
connection.connect();
SASLAuthentication.supportSASLMechanism("PLAIN", 0);
我检查了 smack 调试窗口。它在 XML 中说:
< 无效的身份验证 />
我已经在 gmail 上拥有帐户,并且我的 gtalk 也在运行。