Implement additional env variable to hide loginpage if desired

This commit is contained in:
2026-01-20 19:03:47 +01:00
parent de92a640e2
commit 9dd7c9bc52
9 changed files with 163 additions and 15 deletions

View File

@@ -101,6 +101,7 @@ type OIDCConfig struct {
SkipVerify bool `json:"skipVerify"` // Skip TLS verification (dev only)
UsernameClaim string `json:"usernameClaim"` // Claim to use as username
LogoutURL string `json:"logoutURL"` // Provider logout URL (optional)
SkipLoginPage bool `json:"skipLoginPage"` // Skip login page and redirect directly to OIDC provider (default: false)
}
type AdvancedActionsConfig struct {
@@ -1518,6 +1519,10 @@ func GetOIDCConfigFromEnv() (*OIDCConfig, error) {
}
}
// Skip login page option (default: false)
skipLoginPageEnv := os.Getenv("OIDC_SKIP_LOGINPAGE")
config.SkipLoginPage = skipLoginPageEnv == "true" || skipLoginPageEnv == "1"
config.SessionSecret = os.Getenv("OIDC_SESSION_SECRET")
if config.SessionSecret == "" {
// Generate a random session secret