RSNara / facebook-oauth2

An example of how to do OAUTH2 with facebook.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facebook OAUTH2

Using passport, with the facebook strategy, we authenticate users.

Facebook Setup

  1. Visit facebook. Register a developer account with facebook and make an application.

  2. In the project, create server/constants/secrets.js. Within that file, export two constants: CLIENT_ID, which is your app's App ID, and CLIENT_SECRET, which is your app's App Secret.

  3. Add local.me to the App Domains and http://local.me:3000 as a website to the Platforms. After entering this information, hit Save Changes at the bottom right.

  4. Add 127.0.0.1 local.me to the bottom of etc/hosts.

Running Example

> npm run dev

Open up a browser and visit http://local.me:3000/login/facebook. After you're authorized the application, you should see your access_token in the url.

About

An example of how to do OAUTH2 with facebook.


Languages

Language:JavaScript 84.7%Language:HTML 15.3%