Auth: ignore non-OAuth2 providers when creating social connectors (#86989)

ignore non-oauth2 providers when creating social connectors
This commit is contained in:
Mihai Doarna 2024-04-26 17:14:31 +03:00 committed by GitHub
parent e6f51536bf
commit 45effc48d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import (
"net"
"net/http"
"os"
"slices"
"strings"
"time"
@ -58,6 +59,11 @@ func ProvideService(cfg *setting.Cfg,
}
for _, ssoSetting := range allSettings {
// ignore non-oauth2 providers
if !slices.Contains(ssosettings.AllOAuthProviders, ssoSetting.Provider) {
continue
}
info, err := connectors.CreateOAuthInfoFromKeyValues(ssoSetting.Settings)
if err != nil {
ss.log.Error("Failed to create OAuthInfo for provider", "error", err, "provider", ssoSetting.Provider)