Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using facebook-node-sdk for more than one facebook app #88

Open
krstns opened this issue Nov 21, 2014 · 2 comments
Open

Using facebook-node-sdk for more than one facebook app #88

krstns opened this issue Nov 21, 2014 · 2 comments

Comments

@krstns
Copy link

krstns commented Nov 21, 2014

Hello

We've got a single game server which is used to support multiple games on facebook. Is there any way we could specify multiple app id's and secretes?

Thanks
Krystian

@mjpearson
Copy link

👍

Until the pattern is fixed, it looks possible to create an appsecret_proof signature for API calls and inject them into the parameters in 0.7.3 (not in npm though however)

var crypto = require('crypto'),
  FB = require('fb');

function initParams(accessToken, clientSecret) {
  var hmac = crypto.createHmac('sha256', clientSecret),
    params = {};

  hmac.update(accessToken);

  params.access_token = accessToken;
  params.appsecret_proof = hmac.digest('hex');
  return params;
}

var args = initParams('access_token', 'client_secret');

FB.api('/me/accounts', 'get', args, function(response) {
  // ... do something
} );

https://developers.facebook.com/docs/graph-api/securing-requests

@dantman
Copy link

dantman commented Jan 25, 2016

1.1.0-alpha1 is ready for testing (use npm install fb@^1.1.0-alpha1).

In the 1.1.0 release you can use FB.extend({appId: '...', appSecret: '...'}) to create a new FB instance with its own appId and secret.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants