[proxy] direct redirect to SSO (#5874)

This commit is contained in:
Pascal Fischer
2026-04-14 13:47:02 +02:00
committed by GitHub
parent d7ad908962
commit 46fc8c9f65
2 changed files with 56 additions and 0 deletions

View File

@@ -372,6 +372,12 @@ func (mw *Middleware) authenticateWithSchemes(w http.ResponseWriter, r *http.Req
cd.SetAuthMethod(attemptedMethod)
}
}
if oidcURL, ok := methods[auth.MethodOIDC.String()]; ok && len(methods) == 1 && oidcURL != "" {
http.Redirect(w, r, oidcURL, http.StatusFound)
return
}
web.ServeHTTP(w, r, map[string]any{"methods": methods}, http.StatusUnauthorized)
}