idp-facebook

v0.1.0
OAuth2 Facebook Client
oauth2 facebook

IDPFacebook

Facebook authentication.

var idpFacebook = require('idp-facebook')({ clientID: '1234', clientSecret: 'secret', 'redirectUri': 'http://example.org' });

// Get the auth URL to redirect the user for OAuth2 login
idpFacebook.authUrl({ state: 'session_id' });

// Using the code provided in the query string upon return to your web app, get the identity:
idpFacebook(code, function (err, identity) {
  if (err) {
    console.error('explode');
  }
  else {
    do_amazing_things_with(identity.id, identity.name, identity.url, identity.accessToken);
  }
});
npm i idp-facebook

Metadata

  • BSD-3
  • Whatever
  • connrs
  • released 8/8/2013

Downloads

Maintainers