Login Google Chat For Your Domain?

newbie alert …

I can use Smack to login to talk.google.com using my gmail account; but I can’'t see how to login to a Google Apps For Your Domain account.

So this works:

ConnectionConfiguration config;

String serviceName = “gmail.com”;

String host = “talk.google.com”;

String port = “5222”;

XMPPConnection connection = new XMPPConnection(config);

connection.login(MY_GMAIL_ACCOUNT_NAME, MY_PASSWD);

But, I have “mydomain.com” at Google, and various user accounts on that domain. They are able to chat with one another using Google Talk. Now I’‘m trying to write a client that sends them IMs, so I created a user account for my sending program, "sn1@mydomain.com". I can’'t figure out what to set the service name, host, username to … all my experiments have failed login.

I’'ve tried combinations of

serviceName = “gmail.com

serviceName = “mydomain.com

 serviceName = "mydomain.com@gmail.com"

and

connection.login(“sn1”, SN1_PASSWD);

connection.login("sn1@mydomain.com", SN1_PASSWD);

connection.login("sn1@mydomain.com@gmail.com", SN1_PASSSWD);

So, is there an example of logging into/sending to a Google-hosted domain?

Thanks for any help,

– Wayne

I’'m having the same issue with Google Apps for Your Domain.

I have some code with the following lines to connect to gtalk:

GoogleTalkConnection conn = new GoogleTalkConnection();

conn.login("user@example.com",“password”, “smack”);

They result in the following error:

SASL authentication failed

I’‘ve tested the account with iChat but strangely Adium doesn’'t seem to be able to connect so there must be something different about how Google Apps for Your Domain works.

Anyone have any ideas?

I’'ve figured this one out. I had to play around a bit and checked the source to the GoogleTalkConnection class which gave me the critical clue.

First off you can not use GoogleTalkConnection to set up a connection for Google for your domain. The problem is in the default constructor it essentially creates and XMPPConnection like so:

public GoogleTalkConnection() throws XMPPException {

super(“talk.google.com”, 5222, “gmail.com”);

}

Note the “gmail.com” service name? Well if you just create your XMPPConnection as follows:

XMPPConnection conn = new XMPPConnection(“talk.google.com”, 5222, “my.domain.com”)

where “my.domain.com” is your actual hosted domain. Everything works fine.

This threads a little old, but maybe someone can help. I am having the exact same problem as stidolph. I can login just find with any other account, but cannot login with the Google Apps For Your Domain account. I am using a Coldfusion client and the error that I am getting back is just 405, which from looking around sounds like an authentication error. I have used almost every combination possible of logins, passwords & domains with no luck. My connection string is:

XMPPConnection = createObject(“java”, “org.jivesoftware.smack.XMPPConnection”).init(“talk.google.com”, 5222, “mydomain.com”);

Thanks in advance for any help.

Paul

SOLVED - I used SSLXMPPConnection and port 5223 and everything worked great. I can connect and send messages, but still can’'t receive them. However I am sure that is a completely separate issue.

Paul

Note that legacy SSL connection support will not be part of the next Smack release.