Challenge Overview

Welcome to "Aerohive Responsive Demo App - Web App Integration Part 3 OAuth" Code Challenge. In this challenge, we need your help to create the Node.js server for our new Aerohive demo application that will be able to demonstrate API calls of our products for a retail clothing store.

Background Overview
Aerohive believes in a connected experience. Aerohive delivers an open mobility platform that simplifies and transforms the Connected Experience, through information, insights, and applications. Aerohive's Connected Experience is built on three core solutions that unlock the potential of mobility, and make networks easier to design, deploy, and manage:

Cloud Networking
Unified management designed to simplify administration with enhanced visibility and control, smarter troubleshooting, and flexible deployments through public, private, and on-premises solutions.

Great Wi-Fi
A fully distributed control architecture increases speed, scale, and resiliency, providing a foundation for connectivity that is supported by access layer switches and branch routers.

Applications & Insights
Business and IT applications that increase engagement and fuel business intelligence, powered by APIs, big data, and a partner ecosystem.

Importantly as a result, Aerohive has uniquely been able to create a rich and growing set of open RESTful APIs and a development platform to provide a foundation for Apps that showcase key insights and analytics via data collected while moving across the network on users and device behaviors and enable the ability to enact on that behavior. This is where developers come in! We love developers and encourage the very best and innovative Apps to grow on our platform and in return get visibility to over 30,000 end customers worldwide!

For this challenge we will be exploring a responsive demo for a retail clothing customer. The demo will contain three different Applications that our retail clothing store owners use. Although there will be a lot more functionality for each of these three APPs that will need to be explored, we are only focussing in on three specific use cases for this design challenge. 

Primary Goal
We are looking for you to help us continue with the integration of the Node.js server with the UI Prototype we developed, into a web application that is able to demonstrate calls to Aerohive API and real time web socket communication.

Competition Task Overview
The main task of this competition is to add Authentication to the web application using OAuth.

Requirements
1. Before you get started, you’ll need a developer account. You can register for a free account here: https://developer.aerohive.com/signup
After you are approved, you will receive an email requesting that you activate your account. Upon successful activation, After successful activation, will be taken to your developer account home page. Click on the name of your app to view your client ID and client secret. You will also be able to set your redirect URL for OAuth. The Redirect URL is where we will send the user’s browser after they authorize access on HiveManagerNG.

2. You need to obtain an Access Token using OAuth.
Here is a link with more information about the process (accessible after you are logged in): https://developer.aerohive.com/docs/initial-setup

3. The server will keep in the database several users (username / client_id for Aerohive).
The users will log into our site using the Login screen. Here, only the username will be entered. The password is not needed.
The server will retreive the client_id for Aerohive from the database, and, along with the redirect URI for Aerohive, will open the Aerohive login page:
https://cloud.aerohive.com/thirdpartylogin?client_id=<clientid>&redirect_uri=<redirect-uri>
In that page, the user will enter the Aerohive credentials (email and password).
If correct, that page will send back to the redirect URI the authorization code.
With this authorization code, a permanent Access Token can be obtained from Aerohive.
The permanent Access Token will be stored in session and will be used for Aerohive calls. It will be removed from session when the user logs out.

4. The pages should not be accessible if the user is not logged in.
The web sockets should work only if the user is logged in.
The Aerohive POST webhook should check the token and only process the request if the token matches.

Please don't remove pages or functionality, even if you don't use them. Just deactivate them, or leave them not working.

Resources Provided
Web Application: https://gitlab.com/aerohive/webApp/tree/30054468-webAppOAuth
Storyboards can be found here, if needed: https://gitlab.com/aerohive/designs/tree/master

Final Submission Guidelines

- Upload documentation for how to run your submission
- A video of your working solution is required
- Upload all your source code as a zip for review
- Provide deployed application in Heroku
- The winner will be required to make a Pull request in the branch provided above.

Review style

Final Review

Community Review Board

Approval

User Sign-Off

Challenge links

ID: 30054468