Giter VIP home page Giter VIP logo

oauth2-proxy-manager's Introduction

oauth2-proxy-manager

Docker image

gcr.io/laica-lunasys/oauth2-proxy-manager:latest

Setup

0. Install ingress-nginx(nginx-ingress) in your cluster.

Helm chart: https://github.com/helm/charts/tree/master/stable/nginx-ingress

1. GitHub

1-1. Create OAuth Application

  • Authorization callback URL (ex, https://auth.example.com/github )

https://github.com/settings/applications/new

2. Setup Secret

apiVersion: v1
kind: Secret
metadata:
  name: oauth2-proxy-manager-secret
  namespace: oauth2-proxy
type: Opaque
stringData:
  OAUTH2_PROXY_CLIENT_ID: "xxxxxxx"
  OAUTH2_PROXY_CLIENT_SECRET: "yyyyyy"
  COOKIE_SALT: "U3VzaGkgaXMgR29kLiBCZSBFYXQgU3VzaGkuCg==" # randomized secret strings.

Another manifests can be see: /kubernetes directory.

How to restrict my service?

Example: supersecret app

Fill annotations, and host.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: supersecret
  namespace: supersecret
  annotations:
    # must be use ingress-nginx.
    kubernetes.io/ingress.class: nginx

    # https://auth.example.com/<PROVIDER>/<APP_NAME>/.....
    nginx.ingress.kubernetes.io/auth-signin: https://auth.example.com/github/supersecret/start?rd=https://$host$request_uri$is_args$args
    nginx.ingress.kubernetes.io/auth-url: https://auth.example.com/github/supersecret/auth

    # app-name should be unique.
    oauth2-proxy-manager.k8s.io/app-name: "supersecret"

    # GitHub org, teams
    oauth2-proxy-manager.k8s.io/github-org: "example-corp"
    oauth2-proxy-manager.k8s.io/github-teams: "administrator"
spec:
  rules:
  - host: "supersecret.example.com" # hosts must be provide
    http:
      paths:
      - path: /
        backend:
          serviceName: supersecret
          servicePort: 80

Tada! ๐ŸŽ‰

oauth2-proxy-manager's People

Contributors

laica-lunasys avatar south37 avatar

Watchers

James Cloos avatar  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.