Skip to content

VermontAHS/Authorization

Repository files navigation

Authorization

A prototype authentication and authorization service

About

This is a prototype service for building a desired "to be" single interface for other applications and services to authorize and authenticate users. The future state of this service will allow a variety of different authentication and identity services behind the scenes while all new application development will authenticate with this REST URL pattern. This will help obfuscate the risk associated with leveraging multiple, platform specific authentication and identity providers.

Exploring Open Source Auth Platforms

LemonLDAP NG

LemonLDAP NG is an open source identity access and management platform which leverages open standards to create single sign on experience.

PreReqs

Getting Started

Exploring Custom Auth API Enpoints

Prereqs

This project relies on Node.js and is currently using v8.12.0 LTS. Follow the instructions on how to install Node.js for your operating system.

Install

$> git clone https://github.com/VermontAHS/Authorization && cd Authorization/
$> npm install

Commands

Migrate Database

To keep the prototype light and portable, Sqlite is used as the database

## Create database migrations
$> npm run up

## Rollback database migrations
$> npm run down

Run Tests

$> npm run test

Start Server

$> npm run start

How To

## Run database migrations... These must be run one time before server can work properly
$> npm run up

## Start server
$> npm run start

## Once started, requests can be made to http://localhost:3000

API

Routes

Create User

  • Description: Creates a new user

  • URL: /create

  • Method: POST

  • Request Body:

    • username: Required
    • first_name: Required
    • last_name: Required
    • mi: Optional
    • suffix: Optional
    • email: Required
    • password: Required
  • Response:

    • id: An id generated once user is created

Delete User

  • Description: Deletes a user by id

  • URL: /delete/:id

  • Method: DELETE

  • URL Params:

    • id: Required
  • Response:

    • id: The deleted user id

Update User

  • Description: Updates a user by id

  • URL: /update/:id

  • Method: UPDATE

  • URL Params:

    • id: Required
  • Request Body

    • username: Optional
    • first_name: Optional
    • last_name: Optional
    • mi: Optional
    • suffix: Optional
    • email: Optional
    • password: Optional
  • Response:

    • id: The updated user id

Read User

  • Description: Reads a user by id

  • URL: /user/:id

  • Method: GET

  • URL Params:

    • id: Required
  • Response:

    • id
    • username
    • first_name
    • last_name
    • mi
    • suffix
    • email
    • password

List Users

  • Description: Lists all users

  • URL: /users

  • Method: GET

  • Response:

    • list:
      • id
      • username
      • first_name
      • last_name
      • mi
      • suffix
      • email
      • password

Sign In

  • Description: Sign in a user

  • URL: /signin

  • Method: POST

  • Request Body

    • username: Required
    • email: Required
    • password: Required
  • Response:

    • id
    • username
    • first_name
    • last_name
    • mi
    • suffix
    • email
    • password

About

Authorization API Prototype

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •