diff --git a/pkg/services/login/authinfo.go b/pkg/services/login/authinfo.go index 5174cbde75e..4bdbf9a740a 100644 --- a/pkg/services/login/authinfo.go +++ b/pkg/services/login/authinfo.go @@ -125,6 +125,8 @@ func IsGrafanaAdminExternallySynced(cfg *setting.Cfg, authModule string, oAuthAn switch authModule { case JWTModule: return cfg.JWTAuthAllowAssignGrafanaAdmin + case SAMLAuthModule: + return cfg.SAMLRoleValuesGrafanaAdmin != "" case LDAPAuthModule: return true default: diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index ba1559dfcbc..dc323df3f19 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -515,8 +515,9 @@ type Cfg struct { SecureSocksDSProxy SecureSocksDSProxySettings // SAML Auth - SAMLAuthEnabled bool - SAMLSkipOrgRoleSync bool + SAMLAuthEnabled bool + SAMLSkipOrgRoleSync bool + SAMLRoleValuesGrafanaAdmin string // Okta OAuth OktaAuthEnabled bool @@ -1261,6 +1262,7 @@ func (cfg *Cfg) readSAMLConfig() { samlSec := cfg.Raw.Section("auth.saml") cfg.SAMLAuthEnabled = samlSec.Key("enabled").MustBool(false) cfg.SAMLSkipOrgRoleSync = samlSec.Key("skip_org_role_sync").MustBool(false) + cfg.SAMLRoleValuesGrafanaAdmin = samlSec.Key("role_values_grafana_admin").MustString("") } func (cfg *Cfg) readLDAPConfig() {