From 2edcdc92f4515ef07058b72507275823dacfa7f9 Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 15 Dec 2020 10:49:13 -0800 Subject: [PATCH] Log when unexpected Upstream OIDC Providers found Signed-off-by: Andrew Keesler --- internal/oidc/auth/auth_handler.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/oidc/auth/auth_handler.go b/internal/oidc/auth/auth_handler.go index 774cff26..9375d6d6 100644 --- a/internal/oidc/auth/auth_handler.go +++ b/internal/oidc/auth/auth_handler.go @@ -173,6 +173,13 @@ func chooseUpstreamIDP(idpListGetter oidc.IDPListGetter) (provider.UpstreamOIDCI "No upstream providers are configured", ) } else if len(allUpstreamIDPs) > 1 { + var upstreamIDPNames []string + for _, idp := range allUpstreamIDPs { + upstreamIDPNames = append(upstreamIDPNames, idp.GetName()) + } + + plog.Warning("Too many upstream providers are configured (found: %s)", upstreamIDPNames) + return nil, httperr.New( http.StatusUnprocessableEntity, "Too many upstream providers are configured (support for multiple upstreams is not yet implemented)",