bitly / oauth2_proxy

A reverse proxy that provides authentication with Google, Github or other provider
MIT License
5.1k stars 1.21k forks source link

When asking for the oidc provider, the --oidc-issuer-url is flagged as "not defined" #591

Closed jgn closed 6 years ago

jgn commented 6 years ago

Per the documentation, tried to specify --oidc-issuer-url (with both a single dash and double dash)

But got this: flag provided but not defined: -oidc-issuer-url

Seems like the oidc provider is simply missing.

ploxiln commented 6 years ago

It's in the master branch, but it's not in the v2.2 release (which is over a year old).

jgn commented 6 years ago

Great. After a lot of study I realized that and tried to build a copy with dist.sh - didn't work. Not sure if it's my platform so hesitant to submit an issue on that one.

On Sun, May 13, 2018 at 4:28 PM, Pierce Lopez notifications@github.com wrote:

It's in the master branch, but it's not in the v2.2 release (which is over a year old).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitly/oauth2_proxy/issues/591#issuecomment-388657301, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC38hJAw8m0D0bNNZ78yyp6MNV1mPG2ks5tyKWTgaJpZM4T840o .

-- John G. Norman https://www.linkedin.com/in/johngnorman • VP, Technology • Iora Health http://www.iorahealth.com 101 Tremont Street, 6th floor, Boston, MA 02108 651-356-9929

ploxiln commented 6 years ago

dist.sh does a lot of stuff you don't need. To build oauth2_proxy:

  1. install the "dep" tool from https://github.com/golang/dep (download a stand-alone binary from Releases, put it somewhere in your PATH e.g. /usr/local/bin/, name it dep, make it executable)
  2. checkout the oauth2_proxy repo into your GOPATH, e.g. git clone https://github.com/bitly/oauth2_proxy $HOME/go/src/github.com/bitly/oauth2_proxy
  3. cd into that repo
  4. run dep ensure
  5. run go build
  6. the result is a single stand-alone binary named oauth2_proxy
jgn commented 6 years ago

Super. I'll try it.

On Sun, May 13, 2018 at 6:19 PM, Pierce Lopez notifications@github.com wrote:

dist.sh does a lot of stuff you don't need. To build oauth2_proxy:

  1. install the "dep" tool from https://github.com/golang/dep (download a stand-alone binary from Releases, put it somewhere in your PATH e.g. /usr/local/bin/, name it dep, make it executable)
  2. checkout the oauth2_proxy repo into your GOPATH, e.g. git clone https://github.com/bitly/oauth2_proxy https://github.com/bitly/oauth2_proxy $HOME/go/src/github.com/bitly/ oauth2_proxy
  3. cd into that repo
  4. run dep ensure
  5. run go build
  6. the result is a single stand-alone binary named oauth2_proxy

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitly/oauth2_proxy/issues/591#issuecomment-388663282, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC38qqb2Jc0oemUq7Y2r5i58cgjWaprks5tyL-AgaJpZM4T840o .

-- John G. Norman https://www.linkedin.com/in/johngnorman • VP, Technology • Iora Health http://www.iorahealth.com 101 Tremont Street, 6th floor, Boston, MA 02108 651-356-9929

jgn commented 6 years ago
$ # cloned to $HOME/src/oauth2_proxy
$ export GOPATH=$HOME
$ cd $GOPATH/src/oauth2_proxy
$ dep ensure
Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  github.com/18F/hmacauth

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies,

Solving failure: No versions of gopkg.in/fsnotify.v1 met constraints:
    v1.2.11: unable to update checked out version: fatal: reference is not a tree: 836bfd95fecc0f1511dd66bdbf2b5b61ab8b00b6
: command failed: [git checkout 836bfd95fecc0f1511dd66bdbf2b5b61ab8b00b6]: exit status 128
jgn commented 6 years ago

Closing 'cos original issue might be coming in 2.3. God willing. :-)

ploxiln commented 6 years ago

Yeah ... this repo is not very maintained unfortunately. The build worked for me because of dep's cache. The following change was sufficient to make it work from a fresh state:

--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -4,7 +4,7 @@
 #

 [[constraint]]
-  name = "github.com/18F/hmacauth"
+  name = "github.com/mbland/hmacauth"
   version = "~1.0.1"

 [[constraint]]
@@ -37,6 +37,7 @@

 [[constraint]]
   name = "gopkg.in/fsnotify.v1"
+  source = "gopkg.in/fsnotify/fsnotify.v1"
   version = "~1.2.0"

 [[constraint]]

(fixed in #574 and #577)

jgn commented 6 years ago

Yeesh. dep ensure looks good, but the build . . .

$ go build
# oauth2_proxy
./oauthproxy.go:249:27: p.provider.GetUserName undefined (type
providers.Provider has no field or method GetUserName)
./options.go:275:8: undefined: providers.OIDCProvider
./options.go:279:5: p.Verifier undefined (type providers.Provider has no
field or method Verifier)

On Sun, May 13, 2018 at 8:55 PM, Pierce Lopez notifications@github.com wrote:

Yeah ... this repo is not very maintained unfortunately. The build worked for me because of dep's cache. The following change was sufficient to make it work from a fresh state:

--- a/Gopkg.toml+++ b/Gopkg.toml@@ -4,7 +4,7 @@ #

[[constraint]]- name = "github.com/18F/hmacauth"+ name = "github.com/mbland/hmacauth" version = "~1.0.1"

[[constraint]]@@ -37,6 +37,7 @@

[[constraint]] name = "gopkg.in/fsnotify.v1"+ source = "gopkg.in/fsnotify/fsnotify.v1" version = "~1.2.0"

[[constraint]]

(fixed in #574 https://github.com/bitly/oauth2_proxy/pull/574 and #577 https://github.com/bitly/oauth2_proxy/pull/577)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/bitly/oauth2_proxy/issues/591#issuecomment-388675620, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC38rFvUHuoyc95R9sVQPv8nXazvgB5ks5tyOQNgaJpZM4T840o .

-- John G. Norman https://www.linkedin.com/in/johngnorman • VP, Technology • Iora Health http://www.iorahealth.com 101 Tremont Street, 6th floor, Boston, MA 02108 651-356-9929

ploxiln commented 6 years ago

based on what you pasted earlier, it looks like you're putting the oauth2_proxy repo at $GOPATH/src/oauth2_proxy but it really needs to be at $GOPATH/src/github.com/bitly/oauth2_proxy because one part of it imports another part as "github.com/bitly/oauth2_proxy/providers"

jgn commented 6 years ago

Thanks. Here's what it took:

git diff a94b0a8b25e553f7333f7b84aeb89d9d18ec259b
diff --git a/Gopkg.lock b/Gopkg.lock
index 5a3758a..1294a90 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -131,7 +131,7 @@
   version = "v1.0.0"

 [[projects]]
-  name = "gopkg.in/fsnotify.v1"
+  name = "gopkg.in/fsnotify/fsnotify.v1"
   packages = ["."]
   revision = "836bfd95fecc0f1511dd66bdbf2b5b61ab8b00b6"
   version = "v1.2.11"
@@ -149,6 +149,6 @@
 [solve-meta]
   analyzer-name = "dep"
   analyzer-version = 1
-  inputs-digest = "b502c41a61115d14d6379be26b0300f65d173bdad852f0170d387ebf2d7ec173"
+  inputs-digest = "cfdd05348394cd0597edb858bdba5681665358a963356ed248d98f39373c33b5"
   solver-name = "gps-cdcl"
   solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
index c4005e1..422bd43 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -4,7 +4,7 @@
 #

 [[constraint]]
-  name = "github.com/18F/hmacauth"
+  name = "github.com/mbland/hmacauth"
   version = "~1.0.1"

 [[constraint]]
@@ -36,7 +36,7 @@
   name = "google.golang.org/api"

 [[constraint]]
-  name = "gopkg.in/fsnotify.v1"
+  name = "gopkg.in/fsnotify/fsnotify.v1"
   version = "~1.2.0"

 [[constraint]]
diff --git a/watcher.go b/watcher.go
index bedb9f8..9888fe5 100644
--- a/watcher.go
+++ b/watcher.go
@@ -8,7 +8,7 @@ import (
        "path/filepath"
        "time"

-       "gopkg.in/fsnotify.v1"
+       "gopkg.in/fsnotify/fsnotify.v1"
 )

 func WaitForReplacement(filename string, op fsnotify.Op,