diff options
| -rw-r--r-- | src/oidc/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/oidc/main.go b/src/oidc/main.go index 3c9f057..cca89f5 100644 --- a/src/oidc/main.go +++ b/src/oidc/main.go @@ -8,6 +8,7 @@ import ( "io/ioutil" "log" "net/http" + "os" "text/template" "time" @@ -126,7 +127,11 @@ func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") data, _ := ioutil.ReadFile("openid-configuration.json") tmpl, _ := template.New("test").Parse(string(data)) - tmpl.Execute(w, struct{ Host string }{Host: "http://localhost:8282"}) + host, ok := os.LookupEnv("HOST") + if !ok { + host = "http://localhost:8282" + } + tmpl.Execute(w, struct{ Host string }{Host: host}) } else if r.URL.Path == "/userinfo" { w.WriteHeader(http.StatusNotImplemented) } else if r.URL.Path == "/.well-known/jwks.json" { |
