xmppsmackgoogle-talk

SASL authorization failing while connecting to XMPP server


I am trying to connect to gmail using SMACK API through XMPP server. but getting the

error : SASL authentication failed using mechanism PLAIN

you can check a glimpse of code. I got it from net only

ConnectionConfiguration connConfig = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
connection = new XMPPConnection(connConfig);
connection.connect();
SASLAuthentication.supportSASLMechanism("PLAIN", 0);

I checked in the smack debug window. it says in XML :

< invalid-authzid />

I am already having account on gmail and my gtalk is also running.


Solution

  • You need to set the authentication before you connect viz

    SASLAuthentication.supportSASLMechanism("PLAIN", 0);

    must appear before connection.connect().

    See my blog.