GithubHelp home page GithubHelp logo

oauth2_proxy-1's Introduction

oauth2_proxy dockerization

This is a Dockerization of the handy dandy bitly OAuth Proxy.

Check out the bitly github page for more details on the different command line options that can be passed in.

This is also an automated Docker Hub build

Quickstart with Docker Compose

First, configure your client secret/id/cookie secret in the docker-compose.yml file and replace all references to example.com with your domain.

Then simply run:

docker-compose up

The container will be built and an nginx proxy automatically configure to connect to the oauth2 proxy. Navigate to http://(docker ip)/ping to check out whether the proxy is up and running.

You will be asked to authenticated and if successful, redirected to the upstream nginx container serving a simple HTML page.

Quickstart without Docker Compose

The following example assumes you have your upstream host located at upstream:80

docker run -P a5huynh/oauth2_proxy \
    --cookie-secure=false \
    --upstream="http://upstream:80" \
    --http-address="0.0.0.0:4180" \
    --redirect-url="http://example.com/oauth2/callback" \
    --email-domain="example.com" \
    --cookie-secret=<cookie-secret> \
    --client-id=<client-id> \
    --client-secret=<client-secret>

Configuration

By default I set the upstream and http-address to the following:

--upstream=http://0.0.0.0:8080/
--http-address=0.0.0.0:4180

This allows us to easily configure our upstream or nginx proxy to those addresses.

Environment Variables

Alternatively you can set the cookie-secret, client-id, and/or client-secret as environment variables using the following variables below:

OAUTH2_PROXY_COOKIE_SECRET     # The seed string for secure cookies
OAUTH2_PROXY_CLIENT_ID         # The Google OAuth Client ID
OAUTH2_PROXY_CLIENT_SECRET     # The Google OAuth Client Secret

Example Usage w/ environment variables

docker run -e OAUTH2_PROXY_COOKIE_SECRET=<cookie-secret> \
    -e OAUTH2_PROXY_CLIENT_ID=<client-id> \
    -e OAUTH2_PROXY_CLIENT_SECRET=<client-secret> \
    a5huynh/oauth2_proxy

oauth2_proxy-1's People

Contributors

a5huynh 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.