The purpose of his example is to get access token with login facebook
$npm install
$npm start
http://localhost:3000/
- facebook js sdk
- passport and passport-facebook
- Client side auth
- http://localhost:3000/
- using js sdk of facebook
- config : /views/index.ejs
window.fbAsyncInit = function() {
FB.init({
appId : 'Enter your consumer key here',
xfbml : true,
version : 'v2.5'
});
};
- Server side auth
- http://localhost:3000/facebook
- using passport-facebook
- config : /auth/conf.js
facebook: {
clientId: 'Enter your consumer key here'
, clientSecret: 'Enter your consumer secret here'
, callbackURL: 'Enter your callbackURL here'
, profileFields: ['id', 'displayName', 'photos', 'email'] /* user informations to get */
/* Set the authType option to rerequest when authenticating. */
, options: { authType: 'rerequest', scope: ['email', 'ads_management', 'ads_read'] } /* permissions */
}
- Check user information of session - via [connect-ensure-login]