simple-xmpp / node-simple-xmpp

Simple High Level NodeJS XMPP Client
301 stars 90 forks source link

Facebook Chat, no works! #4

Closed jamlfy closed 12 years ago

jamlfy commented 12 years ago

I'm testing the module, but when I try to connect to facebook chat.

var xmpp = require('simple-xmpp');

xmpp.on('online', function() {
    console.log('Yes, I\'m connected!');
});

xmpp.on('error', function(err) {
    console.error(err);
});

xmpp.connect({
    jid : "12345567890123@chat.facebook.com",
    password : "the_password",
    host : "chat.facebook.com",
    port : 5222
});

The server responds

$ node app.js
XMPP authentication failure

And I do not understand the generated authentication. If there are many applications that have no api

arunoda commented 12 years ago

Facebook uses special way of authenticating. It is not supported by XMPP library behind simple-xmpp.

soggie commented 12 years ago

I managed to get this working. You can't use username/password but you can use the accessToken method. What I did was:

  1. Create a simple app using everyauth
  2. Make sure "xmpp_login" scope is included in the oauth scope for facebook
  3. console.log the returned access_token
  4. Implement the simple-xmpp example in a different app
  5. Provide your JID (google for how to find it), your app_id (remember to create an app in facebook first), set host to chat.facebook.com, and access_token to your user's access token

It works for me, no problems.

arunoda commented 12 years ago

Wow.

Cool. Thanks for sharing your experience.

On Fri, Aug 3, 2012 at 5:24 AM, Ruben Tan Long Zheng < reply@reply.github.com

wrote:

I managed to get this working. You can't use username/password but you can use the accessToken method. What I did was:

  1. Create a simple app using everyauth
  2. Make sure "xmpp_login" scope is included in the oauth scope for facebook
  3. console.log the returned access_token
  4. Implement the simple-xmpp example in a different app
  5. Provide your JID (google for how to find it), your app_id (remember to create an app in facebook first), set host to chat.facebook.com, and access_token to your user's access token

It works for me, no problems.


Reply to this email directly or view it on GitHub: https://github.com/arunoda/node-simple-xmpp/issues/4#issuecomment-7471785

Arunoda Susiripala

@arunoda http://twitter.com/arunoda http://gplus.to/arunodahttps://github.com/arunoda http://www.linkedin.com/in/arunoda

statico commented 12 years ago

+1

Very helpful, @soggie -- thanks!

soggie commented 12 years ago

We should close this case now, because I can confirm it works.

arunoda commented 12 years ago

yep great :)