Wednesday, February 10, 2010

How to enable Facebook Chat in Pidgin using XMPP


Today, Facebook announced XMPP support for Facebook Chat. This is big news, as this means that all XMPP enabled chat clients (including Pidgin) can now connect to Facebook with merely a few simple steps.

Doing so in Pidgin is quick and easy. To start, go to the add accounts menu. When adding an account, you should select the following values:

For the protocol type, select XMPP.
For the username, use your Facebook username. (see http://www.facebook.com/username/)
For the domain, use "chat.facebook.com"
For the password, use your Facebook password.



In advanced, do the following:
Uncheck Require SSL
Set connect port to 5222
Set connect server to chat.facebook.com



That's it! Hit save and you will be logged into Facebook chat.

For those of you who currently use the third party Facebook plugin, we strongly encourage you to switch to using the official Facebook XMPP protocol. The plugin is rife with minor problems and bugs due to how it attempts to use a number of undocumented protocols. Conversely, the XMPP implementation is official and fully supported, and will be far superior in the long run.

You can read the official Facebook blog post at http://developers.facebook.com/news.php?blog=1&story=361

Enjoy!

(Post edited to include necessary advanced settings)

43 comments:

  1. This is neat and all, but I can't seem to get DIGEST-MD5 to actually work. Ultimately, pidgin runs out of mechs to try and I get back a 503 when pidgin falls back to iq:auth

    ReplyDelete
  2. You'll need to use unsecured plain-text authorization, unfortunately. It's probably the one downside to all this.

    ReplyDelete
  3. This should be able to work with Empathy then too, correct? I'm unable to connect and I imagine there's something in your "Advanced" tab that I'm missing.

    ReplyDelete
  4. @Jay:
    It works with empathy: in the account window: add > add new jabber account; reuse an existing account > create > login id: username@chat.facebook.com; advanced: encryption required *not* selected.

    ReplyDelete
  5. I've updated the post to mention that secure connections should be disabled. Thanks for the comments all.

    ReplyDelete
  6. "Allow plaintext auth over unencrypted streams" should be unchecked, meaning the insecure plaintext method is not used (though it's still unencrypted).

    Your line "In advanced, make sure security options are off (no SSL, plaintext authentication)." seems to imply that plaintext is *on*.

    ReplyDelete
  7. Excellent. Just excellent. Thank you.

    ReplyDelete
  8. When I uncheck "allow plaintext auth over unencrypted streams" it then prompts me to say it needs to be allowed, so I say yeah. Then I get a 503: service unavailable.

    ReplyDelete
  9. Do you need to specify "Home" as a resource like in your example? It's not working for me either in Pidgin or Empathy... maybe FB is having some growing pains with their chat servers...

    ReplyDelete
  10. I'm getting a 503 error... maybe Facebook is feeling the slashdot effect :P

    ReplyDelete
  11. Also getting 503 error all day long. Is this something on facebooks end we just need to wait out?

    ReplyDelete
  12. Works for me. Thank you for the heads up!

    Do you know if they will be adding SSL/TLS support?

    ReplyDelete
  13. I will absolutely not be switching until encrypted login is a reality.

    ReplyDelete
  14. Error 503 here too using pidgin 2.6.5-1 under arch

    ReplyDelete
  15. sorry...but what is my username?????
    if my name is alen boksic...:)))...so...my username is alen boksic???surely not...
    email????id that fb assign to me????

    helpppppppppppppppppp!!!!!

    ReplyDelete
  16. 503 in Australia too.

    You can find your username out by logging into Facebook and clicking on Account in the top right hand side of the page. Then you can see/edit your username. If you have been a member of Facebook for ages like me you might not even have a username and you can choose one on that page.

    ReplyDelete
  17. 503 to me too (Israel). in the other hand to a friend using Adium (Mac OS X) it did work.
    my guess is that it's not something with Facebook but with Pidgin, or it's something user specific...

    ReplyDelete
  18. 503 in France... Pidgin 2.6.4 and Empathy 2.28.1

    ReplyDelete
  19. http://www.facebook.com/sitetour/chat.php

    ReplyDelete
  20. 503 in Italy with Pidgin 2.6.5 on 64bit Arch Linux.
    It works perfectly using Empathy or Kopete.

    ReplyDelete
  21. For those of you an arch, you have to install cyrus-sasl. Just figured this out. I'm sure there's a similar package for other Linux distros...

    ReplyDelete
  22. I was getting 503 error messages. Then I went to the link Fred Morcos posted (http://www.facebook.com/sitetour/chat.php), I followed the steps explained there and now I'm loged in :)

    ReplyDelete
  23. It looks like you need to set the "connect server" to "chat.facebook.com" (on the second page) and possible you need to set "resource" to "Pidgin". I also installed cyrus-sasl like mentioned above, I don't know if it was related.

    ReplyDelete
  24. I've updated the post with some additional settings, which some commenters have alluded to.

    In practice, it seems like login is a bit shaky- sometimes I have to press connect several times before it succeeds.

    Thanks for the tips everyone.

    ReplyDelete
  25. Arch Linux user here. Install cyrus-sasl solved the 503 error message for me too, thanks for the tip guys. Now I'm logged in. :)

    ReplyDelete
  26. I can confirm on Arch Linux that installing cyrus-sasl did the trick :D

    ReplyDelete
  27. After changing Home to Pidgin + adding a local alias it works for me! Before that i got 503..

    ReplyDelete
  28. Excellent! I've been wanting this for ages.

    ReplyDelete
  29. Windows Users:

    After constantly getting the 503 error, and double checking settings I deleted the account and re-added it. Though all the settings were the same, re-adding the account seemed to do the trick.

    Link to page with the exact settings.
    http://www.facebook.com/help/?page=779#!/help/?faq=16739

    ReplyDelete
  30. I didn't change anything and finally it works. I suspect facebook changed something on their end.

    ReplyDelete
  31. Some users have no name, they have u_(Facebook_ID)@chat.facebook.com, someone knows the reason?

    ReplyDelete
  32. Facebook says that you should also add chat.facebook.com to the connect server in the advanced settings. The 503 error went away after I did that. See the link people posted earlier: http://www.facebook.com/sitetour/chat.php

    ReplyDelete
  33. I've just set this up, and got it working, using your instructions, which are generally fine, but I think still need a bit of clarification:

    As has already been mentioned, your Facebook username must be the actual username you created (and if you haven't yet, you'll need to create one). You can't use an email address (as you can when logging into FB via your browser).

    On the "Basic" tab, do you need to put "Home" in the resource field? It's shown in the screenshot but not mentioned explicitly in the instructions.

    On the "Advanced" tab it looks like you need to remove the default "proxy.jabber.org" from the File transfer proxies field. The screenshot is confusing because it shows this still in place but doesn't show "chat.facebook.com" in the Connect server field (which you DO need).

    Regards

    Nick

    ReplyDelete
  34. I'm still getting 503 and I've told it to both not allow plain text authentication as well as do allow it. I have a separate "Proxy" tab which has no selection for GNOME Proxy settings. The "proxy.eu.jabber.org" shows up again when I go back into account settings even though I deleted it. Any ideas?

    ReplyDelete
  35. Facebook chat seems to have been having major problems today. Earlier I was getting warnings about plaintext authentication via an encrypted connection, too, where everything had been working fine until then.

    Like you, I have a separate Proxy tab and no Gnome. My proxy tab says "Use Global Proxy Settings" which seems sensible and works.

    You're right about the "proxy.eu.jabber.org" in the File transfer proxies field. I, too, deleted it and I see it's back.

    ReplyDelete