about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
authorAlan Pearce2024-05-21 18:57:30 +0200
committerAlan Pearce2024-05-21 18:57:30 +0200
commit37e18e4303da7c42c0840ad66f64400de816809c (patch)
tree9c4aa0e9999541d8c7df3a381a8003f35c0dfb56 /internal
parent6d0e12252261db9308510816f1e473c0cfecf0db (diff)
downloadwebsite-37e18e4303da7c42c0840ad66f64400de816809c.tar.lz
website-37e18e4303da7c42c0840ad66f64400de816809c.tar.zst
website-37e18e4303da7c42c0840ad66f64400de816809c.zip
redirect OpenID configuration requests to dex
Diffstat (limited to 'internal')
-rw-r--r--internal/server/server.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index cea349f..97851f0 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -188,6 +188,13 @@ func New(runtimeConfig *Config) (*Server, error) {
 			}
 		}
 	})
+	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()