From f9f31425437d95a03d58960e31dd4c699b8f129c Mon Sep 17 00:00:00 2001 From: chenwenxiao Date: Thu, 21 Feb 2019 15:41:09 +0800 Subject: [PATCH] oauth2 --- README.md | 6 +++++ assets/index.html | 16 ++++++++++++ assets/js/index.js | 42 +++++++++++++++++++++----------- httpstaticserver.go | 59 ++++++++++++++++++++++++++++++++------------- main.go | 2 ++ oauth2-proxy.go | 29 ++++++++++++++++++++++ 6 files changed, 123 insertions(+), 31 deletions(-) create mode 100644 oauth2-proxy.go diff --git a/README.md b/README.md index 5604deb..02b8d84 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,12 @@ docker run -it --rm -p 8000:8000 -v $PWD:/app/public --name gohttpserver \ $ gohttpserver --auth-type openid --auth-openid https://login.example-hostname.com/openid/ ``` +- Use oauth2 with + + ```sh + $ gohttpserver --auth-type oauth2-proxy + ``` + - Enable upload ```sh diff --git a/assets/index.html b/assets/index.html index 9d03da0..b7094da 100644 --- a/assets/index.html +++ b/assets/index.html @@ -49,6 +49,19 @@ [[end]] + [[if eq .AuthType "oauth2-proxy"]] + + + [[end]]