Introduction
Passport Facebook authentication strategy using OAuth 2.0
...
Below is a configuration sample that is needed for the Github Facebook strategy to be configured. Follow the steps below the sample to get those configurations.Configuration sample
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
"facebook": {
clientID: '%client_ID%',
clientSecret: '%client_secret%',
callbackURL: '%client_callback%',
//optional
scope: 'email',
profileFields: ['id', 'email', 'name', 'displayName', 'gender']
} |
Configuration Steps
1 - Create a Facebook application
...
Set the callback URL and save.
...
2 - Strategy Configuration
The passport-facebook strategy authenticates users using a Facebook user account and OAuth 2.0 tokens. Client ID and Secret granted in the creation of an app should be added to the config file as options so the strategy will be created. The callback URL will be used to receive the access-token, refresh-token, and profile which is the Facebook authenticated user profile.
...