Skip to content

cprakti/graphql-google-oauth-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL Google OAuth Workshop

Introduction

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:

  1. understand basic OAuth pattern
  2. understand how to use graphQL to obtain a token from your server

Setup

If you have not already, please install:

  1. Run yarn install in both /client and /server.
  2. To start the client, navigate to client and run yarn start. Visit locahost:3000 to see your appplication.
  3. To start the server, start mongoDB with mongod in a separate tab. Then, navigate to server and run node src/app.js.

Auth Code Flow

Guide

  1. Prompt authentication provider login.

  2. Store access token on the client.

  3. Send access token to your server as part of a graphQL mutation.

  4. Verify the token recieved by your server and request user infromation from provider.

  5. Save the user’s data from the provider's response to your database.

  6. Create and return a JWT to the client for protected requests

Not Covered

  1. Client saves JWT and uses token for all authenticated requests

  2. Server uses JWT to allow or deny request and identify current user

Helpful Links

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages