https://github.com/fredlackey/express-passport-entrance
Example entrance application using ExpressJS and PassportJS
https://github.com/fredlackey/express-passport-entrance
Last synced: 2 months ago
JSON representation
Example entrance application using ExpressJS and PassportJS
- Host: GitHub
- URL: https://github.com/fredlackey/express-passport-entrance
- Owner: FredLackey
- License: apache-2.0
- Created: 2019-11-25T17:33:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T14:50:55.000Z (over 2 years ago)
- Last Synced: 2025-01-24T10:30:48.282Z (4 months ago)
- Language: HTML
- Size: 669 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-passport-entrance
Example entrance application using ExpressJS and PassportJS# Background
A friend was venturing into the world of software development and wanted to target MEAN / MERN. He was having difficulty wrapping his head around Passport and OAuth. This repo was the result of an afternoon "bootcamp" session to get him up to speed with the basics.# Concept
User is allowed to signup with a social media account (currently Facebook or Google). Once logged in, they may _link_ or _unlink_ an additional social media account. This allows them to login with _either_ service and load same user account:
# Setup
Installing the project is fairly straight forward:1. Pull down the repo (clone, fork, download, etc.);
2. Install dependencies using `npm install` or `npm i`;
3. Create an app with your social media's developer portal;
4. Set the app's suppliedd `APP_ID` and `SECRET` using an environment variable.# Environment Variables
This project was created using Visual Studio Code and the `.vscode` folder was not checked in (personal preference). You will need to set the environment variables using `export` or however your system requires. Here is a quick look at my VSCode *launch configuration* just in case you want to setup your machine like mine:
# Adding Providers
At the moment, this project is built to handle either Facebook, Google, or both. However, adding a [PassportJS](http://www.passportjs.org/) provider should be quite easy. Simply install the provider you want using `npm install` (they are listed on [passportjs.org](http://www.passportjs.org/)) and then create a defintion object in the `config.js` file similar to the following:
# Contact Info
I'll be happy to help in any way I can. If you find a bug, or have a question which cannot be answered from the usual sources... [Stack Overflow](http://stackoverflow.com/), [Experts Exchange](https://www.experts-exchange.com/), [CodeCall](http://forum.codecall.net/), etc.... feel free to drop me a line:**Fred Lackey**
**[[email protected]](mailto:[email protected])**