Home

Awesome

micro-auth

A microservice that makes adding authentication with Google or GitHub to your application easy.

This service allows you to use Google and GitHub OAuth2 service to add authentication to your applications in a very straightforward way.

It's build with Nginx/OpenResty, Lapis and Docker. This enables the service to be very performant and requires only minimal system resources.

Features

Getting started

Authentication Services

Google

Setup

Visit Google Developers Console and create a new application on Google. Then go to Credentials and create a new OAuth Client ID. Now, get the Client ID and Client secret.

Endpoints

Results

After successful authentication with Google the user is redirect to the URL specified in GOOGLE_REDIRECT_URL with the access token saved in the access_token query parameter.

GitHub

Setup

Visit GitHub and create a new application on GitHub to get your client id and secret.

Endpoints

Results

After successful authentication with GitHub the user is redirect to the URL specified in GITHUB_REDIRECT_URL with the access token saved in the access_token query parameter.

Environment variables

To use the service you must set some required environment variables. These variables can be set in the .env file. Just copy .env.example to .env

$ cp .env.example .env

end set the required variables.

Secrets in docker swarm

Setting the above environment variables with _FILE pointed at the secret mount inside the container. -e GOOGLE_SECRET_FILE=/run/secrets/google_secret. This will set the contents on the file as the value of the environment variable.

General

Google

GitHub

License

See LICENSE

Credits