We are using:
- Github oAuth to authenticate a user
- Hapi server to deal with requests
Steps to get it working:
- Clone the repo
- Move into the directory by typing
cd oauth-exampleinto your terminal - Go here and register a new application https://github.com/settings/developers
- Enter an application name
- Set the Homepage URL to : http://localhost:8000
- Set the Authorization Callback URL to: http://localhost:8000/welcome. And click register application
- create a config.env file in the root of the project directory and enter this info:
GITHUB_CLIENT_ID= *your application's client ID*
GITHUB_CLIENT_SECRET= *your application's client secret*
BASE_URL=http://localhost:8000
- run the server
node lib/server.jsand go to: http://localhost:8000/login