Facebook.getLoginUrl()

Get the URL on facebook.com that a user should visit to allow/deny the specified Facebook Developer app (i.e. your app).

This is the URL where you typically redirect a user in order for them to grant access to your Facebook app.

Usage

Hover over inputs/exits for more info.

var Facebook = require('machinepack-facebook');


// Get the URL on facebook.com that a user should visit to allow/deny the specified Facebook Developer app (i.e. your app).

Facebook.getLoginUrl({

appId: '215798311808508',

callbackUrl: 'http://localhost:1337/user/facebook/login',

permissions: [ 'email' ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

appId required

The unique identifier for your Facebook app (i.e. this is the "App ID" listed on your app's dashboard page in the Facebook developer portal, e.g. https://developers.facebook.com/apps/215293311518502/dashboard)

'215798311808508'
callbackUrl required

The callback URL where the end user will be redirected after visiting the login URL returned by this machine

'http://localhost:1337/user/facebook/login'
permissions

The Facebook permissions requested by this application. Most apps use `["user_friends", "email", and "public_profile"]`. Other permissions may be requested, but require review from Facebook before the app can be used by others. For complete reference of all such permissions, see https://developers.facebook.com/docs/facebook-login/permissions/v2.2#reference

[ 'email' ]

Exits

error

An unexpected error occurred.

success

OK.

'https://www.facebook.com/dialog/oauth?client_id=215798311808508&redirect_uri=http://localhost:1337/user/facebook/login&scope=email,friends'