Skip to content

vojinpavlovic/auth

Repository files navigation

🔒 Auth 🔒

Auth System built in node.js. Architecture is service oriented that communicate via message queue or direct REST API calls.

Table of contents

Features

  • Authentication
  • Authorization
  • Session managment
  • 2fa (soon)
  • Permissions by group
  • Verification
  • Password Reset
  • Configurable

Prerequisites

Get Started

In construction

How it Works

Where does Auth Server stand in service oriented architecture

Auth server is isolated, closely related with nginx api gateway. It can communicate via message queues to other microservices. You can use nginx_gateway

graph TD;
    Nginx-->Auth;
    Auth-->Nginx;
    Auth-->Publish-->Queue;
    Nginx-->Resource;
    Resource-->Consume-->Queue;
    Auth-->MySQL;
    Auth-->Redis;
Loading

How does session managment work with microservices

It's behavior is to either send 2xx for success or 4xx for failure as subrequest for nginx and nginx will either proxy pass if 2xx or return 4xx response to customer.

  • Case when auth/required returns 2xx status http code
graph TD;
    Customer-->Nginx;
    Nginx-->Auth/Required;
    Auth/Required-->Nginx;
    Nginx-->Protected/Resource;
    Protected/Resource-->Customer
Loading
  • Case when auth/required returns 4xx status http code
graph TD;
    Customer-->Nginx;
    Nginx-->Auth/Required;
    Auth/Required-->Nginx;
    Nginx-->Response/4xx;
    Response/4xx-->Customer;
Loading

Configuration

Configuration is one of the project feature. Beside that, it is not clone and run, firstly it needs to be configured to mysql, redis and rabbitmq. Create .env file and copy everything from