Skip to content

a-longhi/oauth2-lite-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oauth2-lite-server

Quality Gate Status

This project has the intention to help developers dive into how OAuth2.0 works, implementing a simple node server. Actually only Authorization Code Flow with Proof Key for Code Exchange (PKCE) is implemented. Note: not for production.

Code structure

  • doc/
  • postman/
  • src/
    • controllers/
    • models/
    • repositories/
    • routes/
    • services/
    • validators/
    • app.js
    • config.js
  • test/
    • config
  • www/

Tech

This project uses a number of open source projects to work properly:

  • Node.js - evented I/O for the backend
  • Express - fast node.js network app framework
  • Mongoose - elegant mongodb object modeling for node.js
  • JWT Auth - JsonWebToken implementation for node.js
  • apiDoc - Inline Documentation for RESTful web APIs
  • Mocha - simple, flexible, fun javascript test framework for node.js

Install

Prerequisites:

Install the dependencies and devDependencies:

$ cd oauth2-lite-server
$ npm install

Run

Prerequisites:

You need to edit src/config.js and put your configuration variables. How to start the server:

$ npm start

How to start the server with livereload:

$ npm run live

Testing

You need to edit the test config file test/config and run:

$ npm test

Documentation

You can see the API documentation on doc/ folder. If you want to re-generate the documentation, you need to run this comand:

$ apidoc -i src/controllers

Development

Want to contribute? Great! Open your pull requests to the develop branch

License

Apache-2.0 See LICENSE.md file

About

A lite implementation of a OAuth2.0 server

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published