redirect OpenID configuration requests to dex
Alan Pearce alan@alanpearce.eu
Tue, 21 May 2024 18:57:30 +0200
1 files changed, 7 insertions(+), 0 deletions(-)
jump to
M internal/server/server.go → internal/server/server.go
@@ -188,6 +188,13 @@ log.Warn("error writing webfinger request", "error", err) } } }) + const oidcPath = "/.well-known/openid-configuration" + mux.HandleFunc( + hostname+oidcPath, + func(w http.ResponseWriter, r *http.Request) { + u := config.OIDCHost.JoinPath(oidcPath) + http.Redirect(w, r, u.String(), 302) + }) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { newURL := runtimeConfig.BaseURL.String() + r.URL.String()