CarlosMecha / nginx-simple-sso

A configuration example for Nginx and your own SSO service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple SSO

This is an example of how to configure nginx for a simple, tiny, homemade SSO system. I'm using a similar configuration for all my side projects hosted in AWS.

Based on this post from Shopware.

Components

  • nginx: Distributes all the incoming requests between the auth service and other applications.
  • site: An application that needs to be secured, it returns the request as an HTML page. This service is not aware of users or credentials.
  • auth: The SSO authentication service. Provides a login page, authenticate and logout methods. Also a REST API to retrieve users.

Requirements

  • Docker
  • Docker compose
  • Go
  • Make

Usage

$ make build
$ docker-compose up

Then, go to your favorite browser and open this. Nginx is configured to redirect all traffic to site, but first it tries to authenticate the request with auth. When no authentication is provided, it redirects the request to the login page.

Links:

About

A configuration example for Nginx and your own SSO service


Languages

Language:Go 91.6%Language:Makefile 7.1%Language:HTML 1.3%