Auth: Always include oauth and saml settings for frontend (#58705)

* Auth: Always include oauth and saml settings
This commit is contained in:
Karl Persson
2022-11-15 10:50:37 +01:00
committed by GitHub
parent d999b5bda0
commit 98dbc637cc
3 changed files with 16 additions and 13 deletions
+14
View File
@@ -198,6 +198,9 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *models.ReqContext) (map[string]i
"unifiedAlerting": map[string]interface{}{
"minInterval": hs.Cfg.UnifiedAlerting.MinInterval.String(),
},
"oauth": hs.getEnabledOAuthProviders(),
"samlEnabled": hs.samlEnabled(),
"samlName": hs.samlName(),
}
if hs.ThumbService != nil {
@@ -501,3 +504,14 @@ func (hs *HTTPServer) pluginSettings(ctx context.Context, orgID int64) (map[stri
return pluginSettings, nil
}
func (hs *HTTPServer) getEnabledOAuthProviders() map[string]interface{} {
providers := make(map[string]interface{})
for key, oauth := range hs.SocialService.GetOAuthInfoProviders() {
providers[key] = map[string]string{
"name": oauth.Name,
"icon": oauth.Icon,
}
}
return providers
}