Sign inSign up

placr/nginx-oauth-adsdemos

By placr

•Updated about 9 years ago

An NGINX based proxy that uses oauth via Google to check if a person is whitelisted

Image
0

1.1K

placr/nginx-oauth-adsdemos repository overview

⁠Usage

This NGINX based docker uses (Google) OAuth to allow access only to a whitelist of users.

How to use:

  1. Create a Google project at https://console.developers.google.com/project⁠
  2. This will produce a Client Id like 2394829874239-asdfs9a87s98adf87s6fd87.apps.googleusercontent.com and a secret.
  3. Put a redirect in the project in like: https://demo.placr.de/_oauth⁠
  4. Put those variables in the header of the NGINX config:

Example:

set $ngo_client_id '2394829874239-asdfs9a87s98adf87s6fd87.apps.googleusercontent.com';
set $ngo_client_secret 'sadf0asfd69sd8f98saf9d8';

Also, set the token secret to something unique for the site. This will be used to create a unique session token.

set $ngo_token_secret 'asqoiweuroiwlkalxzmncbxhxzjhgasdjqoweqjzkcjoas';

Environment variables:

ENV_OAUTH_WHITELIST: A space separated list of e-mail address "[email protected] [email protected]"

⁠Docker run

docker run -d -e ENV_OAUTH_WHITELIST="[email protected]" -p 443:443 --name "oauth" placr/nginx-oauth-adsdemos

Tag summary

Content type

Image

Digest

sha256:57983e7d2…

Size

71.8 MB

Last updated

about 9 years ago

docker pull placr/nginx-oauth-adsdemos