Log when unexpected Upstream OIDC Providers found

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
aram price 2020-12-15 10:49:13 -08:00 committed by Andrew Keesler
parent 08cf2f7cd1
commit 2edcdc92f4

View File

@ -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)",