Giter Site home page Giter Site logo

craguilar / cidm Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 84 KB

Cloud Identity Manager will take care of Authentication and Authorization mechanism as a service for a suite of services.

License: GNU General Public License v3.0

Go 88.40% HTML 0.84% Dockerfile 0.75% TSQL 10.01%
golang security developer-tools swagger docker

cidm's Introduction

Cloud Identity Manager

Cloud Identity Manager (cidm) will take care of Authentication and Authorization mechanism as a service for a suite of services.

Go Report Card

Overview

Actors

  • User client . Actions executed via Web Browser for login only , this actions get translated to REST calls.

  • Service clients (micro services), executed via SSL or any other secure method inside the Customer instance. High level flow

  • User client enters their login credentials

  • Identity Manager Server verifies the credentials are correct and returns a signed JWT token .

  • This token is stored client-side, most commonly in Web Browser local storage .

  • Subsequent User clients requests to the API Gateway server include this token as an additional Authorization header.

  • API Gateway server handover the request to Identity Manager Server decodes the JWT and if the token is valid processes the request

  • Once a user logs out, the token is destroyed client-side, no interaction with the server is necessary.

Authentication

Token-based authentication is stateless. The server does not keep a record of which users are logged in or which JWTs have been issued (at least not explicitly). Instead, every request to the server is accompanied by a token which the server uses to verify the authenticity of the request. The token is generally sent as an addition Authorization header in form of Bearer {JWT} JWT has three distinct parts that are URL encoded for transport:

  • Header: The header contains the metadata for the token and at a minimal contains the type of the signature and/or encryption algorithm
  • Claims: The claims contains any information that you want signed
  • JSON Web Signature (JWS): The headers and claims digitally signed using the algorithm in the specified in the header

Example of JWT Token

//header
{
    "alg": "HS256", //algorithm
    "typ": "JWT" //denotes the type (shorthand typ) of token this is
}
 
//claims
{
    "sub": "[email protected]",
    "name": "Tom Abbott",
    "role": "user"
}

REST API, full programatic access to the internals makes it easy to manage your API users, keys and API Configuration from within your systems

Authorization

Implement simple schema for authorization, based on this principle : who can use Role X to Action on Resoruce Y .

Roles:

  • (GET)roles.Read (resource uri level)
  • (PUT) roles.Update
  • (POST)roles.Create
  • (DELETE)roles.Delete

Resource: defined by Service level

Key Features

  • Authentication with OAuth 2
  • Basic schema for authorization .

Installation

Storage

Install postgresql, reference

Connect to the data base and run the data base creation script available in

/resource/sql/initdb.sql

Setup of OAuth 2

In Google cloud console go to API & Services > OAuth 2.0 client IDs

Code dependencies

Update dependencies with dep

dep ensure

Deployment with Docker

Build docker

docker build -t cimd .

Run docker

docker run --publish 30030:8080  --name cimd --rm cimd

Deployment with

Run install

go install github.com/craguilar/cidm/cmd/cidm-server

TODO

See code hints TODO , for pending actions on this project.

cidm's People

Contributors

craguilar avatar

Stargazers

 avatar

Watchers

 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.