We.js facebook authentication plugin
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
files/public
server/controllers
.gitignore
.jscsrc
.jshintignore
.jshintrc
.npmignore
README.md
install.js
package.json
plugin.js

README.md

We.js facebook authentication strategy

Login with facebook in your we.js project

How to install

we i we-plugin-passport-facebook

How to configure

Create an Application

Before using passport-facebook, you must register an application with Facebook. If you have not already done so, a new application can be created at Facebook Developers. Your application will be issued an app ID and app secret, which need to be provided to the strategy. You will also need to configure a redirect URI which matches the route in your application.

Configure Strategy

To configure in your project update the file: config/locals.js :

// ...
  passport: {
    strategies: {
      facebook: {
        clientID: 'facebook api client id',
        clientSecret: 'facebook api client secret',
        // callbackURL: 'a custom callback url' // optional, if set an root url add / in end ot it
      }
    }
  },
// ...

API

Login with facebook url:

This url will start the authentication.

'get /auth/facebook': {
  controller    : 'passportFacebook',
  action        : 'page',
  responseType  : 'json'
},

Callback from facebook url:

Default callback url:

'get /auth/facebook/callback': {
  controller    : 'passportFacebook',
  action        : 'callback',
  responseType  : 'json'
}

Links

License

Under the MIT license.

Sponsored by