diff options
author | Alan Pearce | 2024-05-21 18:57:30 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-21 18:57:30 +0200 |
commit | 37e18e4303da7c42c0840ad66f64400de816809c (patch) | |
tree | 9c4aa0e9999541d8c7df3a381a8003f35c0dfb56 /internal/server/server.go | |
parent | 6d0e12252261db9308510816f1e473c0cfecf0db (diff) | |
download | website-37e18e4303da7c42c0840ad66f64400de816809c.tar.lz website-37e18e4303da7c42c0840ad66f64400de816809c.tar.zst website-37e18e4303da7c42c0840ad66f64400de816809c.zip |
redirect OpenID configuration requests to dex
Diffstat (limited to 'internal/server/server.go')
-rw-r--r-- | internal/server/server.go | 7 |
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() |