Merge pull request #285 from vmware-tanzu/log-unexpected-upstream

Log when unexpected Upstream OIDC Providers found
This commit is contained in:
Andrew Keesler 2020-12-15 15:30:20 -05:00 committed by GitHub
commit 3d4717b772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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",
)
} 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)",