This plugin is used by seneca-auth for authenticating via facebook login. It uses PassportJS. The seneca-auth is the authentication plugin used by Seneca toolkit.
For a gentle introduction to Seneca itself, see the senecajs.org site.
If you're using this plugin module, feel to contact on twitter if you have any questions! :) @rjrodger
npm install seneca-facebook-auth
seneca-facebook-auth's source can be read in an annotated fashion by,
- running
npm run annotate
- viewing online.
The annotated source can be found locally at ./doc/facebook-auth.html.
When using seneca-auth the facebook auth must be initialized using:
..........
service: {
"local": {},
"facebook" : {
"appId" : "your app id",
"appSecret" : "app secret",
"urlhost" : "server host",
"serviceParams": {
"scope" : [
"email"
]
}
}
}
..........
Note: serviceParams can be used to pass any other parameter to the passport facebook strategy. For example scope can be used to request special access permissions to user data at login time. More information can be found in the Facebook documentation.
There is provided a default seneca action that will prepare user data to a more convenient structure. If this data structure is not matching the expected user data structure used by your application, you can overwrite the seneca action and implement your own facebook_login_data action.
- {role: 'facebook', prepare: 'facebook_login_data'}
The JSON object provided for this actions contains following data from Facebook login:
- accessToken
- refreshToken
- profile
The Senecajs org encourage open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.
Copyright Nicolas Herment and other contributors 2015, Licensed under MIT.