Skip to content

Opinionated Oauth2 Server implementation, written with Typescript.

Notifications You must be signed in to change notification settings

tashima42/nodejs-oauth2-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-oauth2-server

Quick overview:

You can start by using the Postman Collection
You should make requests in the order they are, there are automatic tests that will set the collection variables for you.

Disclaimers:

  • NEVER use this in production, this implementation INSECURE, but it's a good start point to understand how OAuth 2.0 works
  • This implementation is loosely based on 14gasher/oauth-example. Most things are different, but the initial idea and the starting point comes from his project.

Table of Contents

  1. How to understand this repository
  2. Documentation
  3. Installation and Setup
  4. File Structure

How to understand this repository

  1. First, you should have a basic understanding of how Oauth2 works.
  2. Look at the Postman Collection on the quick overview section and do some requests, try to understand how they compare to the sequence diagram below.
  3. Go to the use-cases folder, and go folder by folder, in the same order as they are on the Postman Collection
  4. Inside each folder, you should read first the DTO file, and understand what is the request and response objects for each request
  5. To understand how the request parameters are used and how the response ones are generated, read the use-case file, which contains all the business logic

Documentation

This OAuth2.0 implementation is meant to be an example for Toolbox CloudPass. Follow the official documentation for more detailed instructions. https://toolboxdigital.atlassian.net/wiki/spaces/DDP/pages/72293671/CloudPass+Integration+Guide+method+OAuth+2.0+Protocol

flow

Installation and Setup

  1. Clone this Repo
  2. Go to project folder cd nodejs-oauth2-server
  3. Install the dependencies npm install
  4. Prepare the database
    1. Run the database migrations and populate npm run db:migrate:populate
  5. Start the tests npm run test
  6. Start the server
    • Run in development mode npm run dev
    • Run in "production" (you shouldn't run this in production) mode npm run start

About

Opinionated Oauth2 Server implementation, written with Typescript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published