开发者

Java and Jabber/Smack [closed]

开发者 https://www.devze.com 2023-03-19 08:07 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about programming within the scope defined in the help center.

Closed 9 years ago.

开发者_StackOverflow Improve this question

I am trying to code a simple example using the latest version of Smack (3.2.1) to send and receive messages between two accounts.

Connection connection = new XMPPConnection("jabber.org");
connection.connect();
connection.login("username", "password");

But I can't even get past the login part. When I run the above code I get this exception:

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)

What is going on here? I am sure my username and password work because I can log in using my IM client.

And can anyone point me to current working Smack examples? This is very frustrating because the documentation and the library seem out of sync.

Thanks-


Could you check that you are not adding "@jabber.org" at the end of the username? if you do, it will not work.

Otherwise, if you do that already, you may want to try using

SASLAuthentication.supportSASLMechanism("PLAIN", 0);

before

connection.login("username", "password");

0

精彩评论

暂无评论...
验证码 换一张
取 消