Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

New facebook authentication mechanism #37

Merged
merged 2 commits into from

2 participants

@cheggaaa

Hello!
Now you must send access_token
http://developers.facebook.com/docs/chat/

@astro astro merged commit 158cb99 into node-xmpp:master
@astro
Owner

Thanks. Would you like me to make a release for npm?

@cheggaaa

Yes, it's a good idea :-)
Usage example: https://gist.github.com/1267770

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 6, 2011
  1. @cheggaaa

    New facebook auth

    cheggaaa authored
  2. @cheggaaa

    clean

    cheggaaa authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 12 deletions.
  1. +2 −4 lib/xmpp/client.js
  2. +1 −8 lib/xmpp/sasl.js
View
6 lib/xmpp/client.js
@@ -37,8 +37,7 @@ function Client(params) {
this.jid = params.jid;
this.password = params.password;
this.api_key = params.api_key;
- this.secret_key = params.secret_key;
- this.session_key = params.session_key;
+ this.access_token = params.access_token;
this.xmlns[''] = NS_CLIENT;
this.xmppVersion = "1.0";
this.streamTo = this.jid.domain;
@@ -154,8 +153,7 @@ Client.prototype.useFeatures = function() {
this.mech.authcid = this.jid.user;
this.mech.password = this.password;
this.mech.api_key = this.api_key;
- this.mech.secret_key = this.secret_key;
- this.mech.session_key = this.session_key;
+ this.mech.access_token = this.access_token;
this.mech.realm = this.jid.domain; // anything?
this.mech.digest_uri = "xmpp/" + this.jid.domain;
var authMsg = encode64(this.mech.auth());
View
9 lib/xmpp/sasl.js
@@ -58,17 +58,10 @@ function XFacebookPlatform() {
call_id: new Date().getTime(),
method: dict.method,
nonce: dict.nonce,
- session_key: this.session_key,
+ access_token: this.access_token,
v: "1.0"
};
- var message = '';
- ['api_key', 'call_id', 'method', 'nonce', 'session_key', 'v'].forEach(function(v) {
- message += v + "=" + response[v];
- });
-
- response.sig = md5(message + this.secret_key, 'hex');
-
return querystring.stringify(response);
};
}
Something went wrong with that request. Please try again.