Code Monkey home page Code Monkey logo

ego's Introduction

EGO


A scalable stateless Authorization Service for Federated Identities including Google and Facebook

Build Status CircleCI

Table of Contents

Introduction

License

Authorization Service built to provide Single Sign On for various microservices in an application. EGO works with Identity Providers such as Google, Facebook to provide social logins in the application. EGO provides stateless authorization using JWT (JSON Web Tokens) and can scale very well to a large number of users.

Interactive documentation of the API is provided using Swagger UI.

When run locally this can be found at: http://localhost:8081/swagger-ui.html

arch

EGO Architecture

Features

Here are some of the features of EGO:

  • Single Sign on for microservices
  • User-authentication through Federated Identities such as Google, Facebook, Github (Coming Soon), ORCID (Coming Soon)
  • Uses JWT(Json Web Tokens) for Authorization Tokens
  • Built using well established Frameworks - Spring Boot, Spring Security

Tech Stack

The application is written in JAVA using Spring Boot and Spring Security Frameworks.

Quick Start

The goal of this quick start is to get a working application quickly up and running.

Set the API_HOST_PORT where ego is to be run, then run docker compose:

API_HOST_PORT=8080 docker-compose up -d

Ego should now be deployed locally with the swagger ui at http://localhost:8080/swagger-ui.html

Development Install

Step 1 - Setup Database

  1. Install Postgres
  2. Create a Database: ego with user postgres and empty password
  3. Execute SQL Script to setup tables.

Step 2 - Run

  • EGO currently supports three Profiles:
    • default: Use this to run the most simple setup. This lets you test various API endpoints without a valid JWT in authorization header.
    • auth: Run this to include validations for JWT.
    • secure: Run this profile to enable https
  • Run using Maven. Maven can be used to prepare a runnable jar file, as well as the uber-jar for deployment:
$ mvn clean package

To run from command line with maven:

$ mvn spring-boot:run

Tech Specifications

ego JWT will have a similar format as the one described in RFC: kf-auth-rfc An example ego JWT is mentioned below:

{
    "alg": "HS512"
}
.
{
    "sub": "1234567", 
    "iss": "ego:56fc3842ccf2c1c7ec5c5d14",
    "iat": 1459458458,
    "exp": 1459487258,
    "jti": "56fd919accf2c1c7ec5c5d16",
    "aud": [
        "service1-id",
        "service2-id",
        "service3-id"
    ],
    "context": {
        "user": {
            "name": "[email protected]",
            "email": "[email protected]",
            "status": "Approved",
            "firstName": "Demo",
            "lastName": "User",
            "createdAt": "2017-11-23 10:24:41",
            "lastLogin": "2017-11-23 11:23:58",
            "preferredLanguage": null,
            "roles": ["ADMIN"]
        }
    }
}
.
[signature]

Notes

  • "aud" field can contain one or more client IDs. This field indicates the client services that are authorized to use this JWT.
  • "groups" will differ based on the domain of client services - each domain of service should get list of groups from that domain's ego service

ego's People

Contributors

joneubank avatar andricdu avatar jephuff avatar fgerthoffert avatar dankolbman avatar alubneuski avatar jongdevops avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.