-
Notifications
You must be signed in to change notification settings - Fork 1
/
tutorial
27 lines (20 loc) · 1.14 KB
/
tutorial
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
This example demonstrates how to use [Express](http://expressjs.com/) 4.x and
[Passport](http://passportjs.org/) to authenticate users using Facebook. Use
this example as a starting point for your own web applications.
## Instructions
To install this example on your computer, clone the repository and install
dependencies.
```bash
$ git clone git@github.com:passport/express-4.x-facebook-example.git
$ cd express-4.x-facebook-example
$ npm install
```
The example uses environment variables to configure the consumer key and
consumer secret needed to access Facebook's API. Start the server with those
variables set to the appropriate credentials.
```bash
$ CLIENT_ID=__FACEBOOK_CLIENT_ID__ CLIENT_SECRET=__FACEBOOK_CLIENT_SECRET__ node server.js
```
Open a web browser and navigate to [http://localhost:3000/](http://localhost:3000/)
to see the example in action.
<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/vK9dyjRnnWsMzzJTQ57fRJpH/passport/express-4.x-facebook-example'> <img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/vK9dyjRnnWsMzzJTQ57fRJpH/passport/express-4.x-facebook-example.svg' /></a>