Google OAuth 2.0
Assignment 3

Due before our week 13 class.

Counts for 10% of your final grade.

# The brief

This is the third of three take home assignments related to building a backend web service to support a simple pokemon application called pokemon.

In the previous assignments you built the base for the pokemon RESTful API using Node.js, the Express framework and MongoDB. For this assignment you will enhance that foundation with Google OAuth 2.0 authentication.

In addition to correctly implementing all of the requirements from the previous assignment. The application will implement the following.

# Core Requirements

  1. Create a new /auth router module that will support
  • redirecting a user to google api for authentication
  • handle the callback from google
  • logging out the current user
  1. The user schema should have the following properties:

    Property Type Required
    name String true
    googleId String true
    createdAt Date true
    updatedAt Date true
  2. All GET requests are available to authenticated or unauthenticated users.

  3. All POST, PUT, PATCH, and DELETE routes for the pokemon resource paths should be limited to authenticated users.

  4. Ensure that you write clean and readable code. Pay attention to:

  • no runtime errors
  • consistent 2 space indentation
  • logical grouping of related code
  • semantically descriptive names for variables and functions
  • well organized project folder structure
  • properly formatted package.json file
    • correct project name
    • your author details

# Logistics

  • Create a new folder in you mad9124 repository.
  • Copy your previous Pokemon code.
  • Build the project on your laptop.
  • Test each route with Postman.
  • Make git commits as you complete each requirement
  • When everything is complete, push the final commit back up to GitHub and submit the GitHub repo's URL on Brightspace.

TIP

It is a good habit to make a git commit as you complete each logical requirement. This not only tracks your progress, but protects your working code in case you later break it and need to roll back.

Last Updated: 3/29/2023, 9:11:22 PM