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
1 changed files with 7 additions and 0 deletions

View File

@ -173,6 +173,13 @@ func chooseUpstreamIDP(idpListGetter oidc.IDPListGetter) (provider.UpstreamOIDCI
"No upstream providers are configured", "No upstream providers are configured",
) )
} else if len(allUpstreamIDPs) > 1 { } 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( return nil, httperr.New(
http.StatusUnprocessableEntity, http.StatusUnprocessableEntity,
"Too many upstream providers are configured (support for multiple upstreams is not yet implemented)", "Too many upstream providers are configured (support for multiple upstreams is not yet implemented)",