Coder Social home page Coder Social logo

mediaranker-oauth's Introduction

Adding OAuth to Media Ranker

Learning Goals

  • Practice using OAuth in a web application
  • Practice using Session Variables to track a user across multiple HTTP requests

Exercise Description

Our Media Ranker web app was a wonderful website with one major flaw: the way we implemented user login is extremely insecure. In this assignment you will modify Media Ranker so that it can securely authenticate multiple users via OAuth and authorize them to view, manage and vote on works.

Build your project using branches, with at least one branch per wave. As you finish a wave merge the changes into the main branch. You shall submit one pull request at the end once you are complete.

For this project, you should use the instructor version of MediaRanker.

Wave 1: Authentication via OAuth

Following the steps in the Textbook curriculum, add OAuth to your Media Ranker Application and enable a user to log in.

Requirements:

  • Add all necessary gems and configuration
  • Repurpose the existing login functionality to now be a single log in button (on home page or nav bar)
  • The log in button shall turn in to a log out button when the user is logged in
  • All other requirements from in-class notes apply:
    • Managed via session
    • SessionsController
    • User model

Wave 2: Basic Authorization (Page Access)

In this wave we will create authorization logic to enforce rules that govern what pages on the site users and guests (unauthenticated browsers) can view. The rule we'll use is that guests can only access the main page, and all logged-in users can access the show and index pages for all categories of work.

Requirements:

  • Ensure that users who are not logged in can see only the main page with the spotlight and top 10 items. No other pages should be viewable by the guest user.
  • Ensure that users who are logged in can see the rest of the pages.

Wave 3: Advanced Authorization (Ownership)

In this wave we'll create advanced authorization logic to enforce rules that govern what changes users can make to the site's data. The rules here are more complex than for accessing pages:

  • Guests cannot change any data on the site
  • All logged-in users can add new works to the site
    • Those works are owned by the user that created them
  • The user who owns a given work can:
    • Edit that work
    • Delete that work

Requirements:

  • Modify the edit and delete functionality to ensure that users can only change works they are associated with.
    • Optional: Consider how this could be implemented at the model layer.

Wave 4: Optional

Do some research into how to use Google or another OAuth provider for authentication and use that provider.

Resources

mediaranker-oauth's People

Watchers

 avatar  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.