diff --git a/pkg/http/server.go b/pkg/http/server.go index 7397e54a8..a35ce7a60 100644 --- a/pkg/http/server.go +++ b/pkg/http/server.go @@ -6,6 +6,7 @@ import ( "io" "log/slog" "net/http" + "net/url" "os" "os/signal" "slices" @@ -127,6 +128,14 @@ func RunHTTPServer(cfg ServerConfig) error { BaseURL: cfg.BaseURL, ResourcePath: cfg.ResourcePath, } + if cfg.Host != "" { + u := &url.URL{ + Scheme: "https", + Host: cfg.Host, + Path: "/login/oauth", + } + oauthCfg.AuthorizationServer = u.String() + } serverOptions := []HandlerOption{} if cfg.ScopeChallenge {