Giter Site home page Giter Site logo

graphql-google-oauth-example's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.