Skip to content

example of using passport-facebook, passport-instagram strategies

Notifications You must be signed in to change notification settings

dimalakh/sample-passport-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sample-passport-auth

  1. npm install
  2. Create facebook and instagram app ids
  3. Create .env file and set env-variables
JWT_SECRET_KEY=
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
INSTAGRAM_CLIENT_ID=
INSTAGRAM_CLIENT_SECRET=
  1. sudo service mongod start
  2. npm start

Create account with email

POST http://localhost:3000/auth/signup

BODY
email: '[email protected]'
password: 'yourpassword'

POST http://localhost:3000/auth/login

BODY
email: '[email protected]'
password: 'yourpassword'

Auth via social

GET http://localhost:3000/auth/facebook
GET http://localhost:3000/auth/instagram

Both return token

Get protected data

GET http://localhost:3000/profile

HEADER
Authorization: Bearer your_token

return your data like

{
  "_id": "5982e3e43ce2f42c443b3776",
   "facebookId": "6276396097532207",
}

About

example of using passport-facebook, passport-instagram strategies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published