Skip to content

Concorda/seneca-facebook-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seneca seneca-facebook-auth - a seneca-auth plugin

npm version Build Status Dependency Status Gitter chat

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

Install

npm install seneca-facebook-auth

About

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.

Using Facebook Auth

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.

Other information

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

Contributing

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.

License

Copyright Nicolas Herment and other contributors 2015, Licensed under MIT.

About

facebook auth plugin for seneca-auth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published