Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3795f9a
commit 8739f7e
Showing
24 changed files
with
2,093 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# Tab indentation (no size specified) | ||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.vscode | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"id": "10222066713524004", | ||
"displayName": "Fred Lackey", | ||
"name": {}, | ||
"emails": [ | ||
{ | ||
"value": "fred.lackey@gmail.com" | ||
} | ||
], | ||
"photos": [ | ||
{ | ||
"value": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=10222066713524004&height=50&width=50&ext=1576869618&hash=AeTiJwoocfRO7fz-" | ||
} | ||
], | ||
"provider": "facebook", | ||
"_raw": "{\"id\":\"10222066713524004\",\"name\":\"Fred Lackey\",\"picture\":{\"data\":{\"height\":50,\"is_silhouette\":false,\"url\":\"https:\\/\\/platform-lookaside.fbsbx.com\\/platform\\/profilepic\\/?asid=10222066713524004&height=50&width=50&ext=1576869618&hash=AeTiJwoocfRO7fz-\",\"width\":50}},\"email\":\"fred.lackey\\u0040gmail.com\"}", | ||
"_json": { | ||
"id": "10222066713524004", | ||
"name": "Fred Lackey", | ||
"picture": { | ||
"data": { | ||
"height": 50, | ||
"is_silhouette": false, | ||
"url": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=10222066713524004&height=50&width=50&ext=1576869618&hash=AeTiJwoocfRO7fz-", | ||
"width": 50 | ||
} | ||
}, | ||
"email": "fred.lackey@gmail.com" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"id": "101696439243972098765", | ||
"displayName": "Fred Lackey", | ||
"name": { | ||
"familyName": "Lackey", | ||
"givenName": "Fred" | ||
}, | ||
"emails": [ | ||
{ | ||
"value": "fred.lackey@gmail.com", | ||
"verified": true | ||
} | ||
], | ||
"photos": [ | ||
{ | ||
"value": "https://lh3.googleusercontent.com/a-/AAuE7mCM0fXWGxCU1Ifwei4Ia3zuhpS1R6woJuOz7EaroA" | ||
} | ||
], | ||
"provider": "google", | ||
"_raw": "{\n \"sub\": \"101696439243972098765\",\n \"name\": \"Fred Lackey\",\n \"given_name\": \"Fred\",\n \"family_name\": \"Lackey\",\n \"picture\": \"https://lh3.googleusercontent.com/a-/AAuE7mCM0fXWGxCU1Ifwei4Ia3zuhpS1R6woJuOz7EaroA\",\n \"email\": \"fred.lackey@gmail.com\",\n \"email_verified\": true,\n \"locale\": \"en\"\n}", | ||
"_json": { | ||
"sub": "101696439243972098765", | ||
"name": "Fred Lackey", | ||
"given_name": "Fred", | ||
"family_name": "Lackey", | ||
"picture": "https://lh3.googleusercontent.com/a-/AAuE7mCM0fXWGxCU1Ifwei4Ia3zuhpS1R6woJuOz7EaroA", | ||
"email": "fred.lackey@gmail.com", | ||
"email_verified": true, | ||
"locale": "en" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
# 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 Bootstrap). 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: | ||
|
||
![Profile Page](/docs/images/profile.png "Profile Page") | ||
|
||
# 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. 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: | ||
|
||
![Launch Configuration](/docs/images/launch-json.png "Launch Configuration") | ||
|
||
# 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 from [passportjs.org](http://www.passportjs.org/) and then create a defintion object in the `config.js` file similar to the following: | ||
|
||
![Config File](/docs/images/config.png "Config File") | ||
|
||
# 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 | ||
### [fred.lackey@gmail.com](mailto://fred.lackey@gmail.com) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.