- Whenever you see the logos:
- Sign-In With Google+
- Login With Facebook You Should Know That the Web App is using OAuth to authenticate users on its system
- I Sign Into The Platform
- My browser makes a request to the server to access a specific path
- The server responds with a Yes/No Response depending on the credentials
- If The Credentials are correct I am granted access
- Else I am told to create a new user
- When I create/sign in as a user it queries the db
- A unique cookie based session is created
- The browser stores the cookie
- I decrypt the encrypted information stored inside the cookie to retrieve the user data
- Express to create My Web App
- EJS For the templating engines
- localhost:3000/auth/google
- localhost:3000/auth/facebook
- localhost:3000/auth/github
- localhost:3000/auth/login
npm install passport
npm install passport-google-oauth20
-
To be able to use google OAuth in your application You must register your app with google
-
We do not want to store our credentials in the file here within the config folder inside the passport-setup.js
-
Instead I create a file within the config folder called keys which I DO NOT COMMIT TO the repository instead I
-
store it on my local machine
-
I add the file I do not want to be uploaded to my .gitignore file so that it is not tracked in my case it would be the keys file