This project was bootstrapped with Create React App.
Goal: The purpose of this app is to practice using graphQL and Google OAuth to successfully authenticate in an app.
Learning Objectives:
- understand basic OAuth pattern
- understand how to use graphQL to obtain a token from your server
If you have not already, please install:
- Run
yarn install
in both/client
and/server
. - To start the client, navigate to
client
and runyarn start
. Visit locahost:3000 to see your appplication. - To start the server, start mongoDB with
mongod
in a separate tab. Then, navigate toserver
and runnode src/app.js
.
-
Prompt authentication provider login.
-
Store access token on the client.
-
Send access token to your server as part of a graphQL mutation.
-
Verify the token recieved by your server and request user infromation from provider.
-
Save the user’s data from the provider's response to your database.
-
Create and return a JWT to the client for protected requests
Not Covered
-
Client saves JWT and uses token for all authenticated requests
-
Server uses JWT to allow or deny request and identify current user
- OAuth overview - https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2
- Create a project - https://console.developers.google.com/
- GraphQL auth strategies - https://blog.apollographql.com/authorization-in-graphql-452b1c402a9
- Brew install mongodb - https://treehouse.github.io/installation-guides/mac/mongo-mac.html
- Mongoose overview - https://www.freecodecamp.org/news/introduction-to-mongoose-for-mongodb-d2a7aa593c57/
- Passport docs - http://www.passportjs.org/docs/authenticate/