Giter Club home page Giter Club logo

acl2-28-oauth's Introduction

Why I Autha...

I'm sorry for the name

Getting Started

Use this template to get started.

Learning Objectives

  • Use OAuth to create & log in users
  • Use Express middleware to ensure requests are authenticated
  • Use cookies to store user data
  • Use JWTs for storing user data in cookies
  • Sign & verify JWTs to ensure validitity
  • Utilize GitHub OAuth for authentication

Description

You've been selected to interview at GitHub for a Software Developer position. As part of the interview process, you've been asked to build an authentication system that uses GitHub's OAuth.

You've been provided a template that contains an API and some tests, but needs two of the routes implemented: /api/v1/github/login and /api/v1/github/login/callback.

In order to complete those routes, you'll need to implement the methods in the /utils/github.js file.

You will need to create an OAuth app on GitHub for this deliverable

Acceptance Criteria

  • User is redirected to the GitHub authorization page when visiting /api/v1/github/login
  • /api/v1/github/login/callback implements the GitHub OAuth flow to get a user's profile information (namely login, avatar, and email)
    • Upon getting the profile information, find the existing GithubUser by their username
      • If one doesn't exist, create it
    • Create a JWT with that user's information
    • Set the JWT in a server-side cookie, then redirect the user to /api/v1/github/dashboard

Rubric

Task Points
/api/v1/github/login implemented 1
/api/v1/github/login/callback implemented 2
exchangeCodeForToken implemented 2
getGithubProfile implemented 2
Logging in sets a server-side cookie 1
Existing tests pass 2

acl2-28-oauth's People

Contributors

dylan-floyd avatar

Watchers

 avatar

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.