lib/security/providers/facebook.js
function _getPersistantFacebookToken(){
    return facebook.query()
            .get('/oauth/access_token?' +
                'grant_type=fb_exchange_token&' +
                'client_id=' + appId + '&' +
                'client_secret=' + secret + '&' +
                'fb_exchange_token=' + this.options.code)
            .request()
            .then(function (res) {
                // Bad tokens result in a 200 with an error object
                if (res[1].error) {
                    throw new Error(res[1].error.message);
                }

                this.creds = querystring.parse(res[1]);
            }.bind(this));
}
function _getPersistantFacebookToken(){
    return facebook.query()
            .get('/oauth/access_token?' +
                'grant_type=fb_exchange_token&' +
                'client_id=' + appId + '&' +
                'client_secret=' + secret + '&' +
                'fb_exchange_token=' + this.options.code)
            .request()
            .then(function (res) {
                // Bad tokens result in a 200 with an error object
                if (res[1].error) {
                    throw new Error(res[1].error.message);
                }

                this.creds = querystring.parse(res[1]);
            }.bind(this));
}
function _getPersistantFacebookToken ( ) { return facebook . query ( ) . get ( '/oauth/access_token?' + 'grant_type=fb_exchange_token&' + 'client_id=' + appId + '&' + 'client_secret=' + secret + '&' + 'fb_exchange_token=' + this . options . code ) . request ( ) . then ( function ( res ) { // Bad tokens result in a 200 with an error object if ( res [ 1 ] . error ) { throw new Error ( res [ 1 ] . error . message ) ; } this . creds = querystring . parse ( res [ 1 ] ) ; } . bind ( this ) ) ; }
Function will accept the passed in authentication token from FB and exchange it for a permenant token. This token will be saved to the user's identities profile.
Function will accept the passed in authentication token from FB and exchange it for a permenant token . This token will be saved to the user s identities profile .