Auth: OAuth sets skip_org_role_sync = true for auth.google by default (#72819)

* sets skip_org_role_sync to true for google

* add google skiporgrolesync and sets to true always

* add field

* Update docs/sources/setup-grafana/configure-security/configure-authentication/google/index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* add AKS to words

* script back to mina

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
Eric Leijonmarck
2023-08-04 16:17:35 +02:00
committed by GitHub
co-authored by Christopher Moyer
parent 3395ad03a7
commit 95760cb021
4 changed files with 11 additions and 7 deletions
+3 -2
View File
@@ -20,8 +20,9 @@ const googleIAMScope = "https://www.googleapis.com/auth/cloud-identity.groups.re
type SocialGoogle struct {
*SocialBase
hostedDomain string
apiUrl string
hostedDomain string
apiUrl string
skipOrgRoleSync bool
}
type googleUserData struct {
+4 -3
View File
@@ -189,9 +189,10 @@ func ProvideService(cfg *setting.Cfg,
ss.log.Warn("Using legacy Google API URL, please update your configuration")
}
ss.socialMap["google"] = &SocialGoogle{
SocialBase: newSocialBase(name, &config, info, cfg.AutoAssignOrgRole, cfg.OAuthSkipOrgRoleUpdateSync, *features),
hostedDomain: info.HostedDomain,
apiUrl: info.ApiUrl,
SocialBase: newSocialBase(name, &config, info, cfg.AutoAssignOrgRole, cfg.OAuthSkipOrgRoleUpdateSync, *features),
hostedDomain: info.HostedDomain,
apiUrl: info.ApiUrl,
skipOrgRoleSync: cfg.GoogleSkipOrgRoleSync,
}
}
+3 -1
View File
@@ -1482,7 +1482,9 @@ func readAuthGithubSettings(cfg *Cfg) {
func readAuthGoogleSettings(cfg *Cfg) {
sec := cfg.SectionWithEnvOverrides("auth.google")
cfg.GoogleAuthEnabled = sec.Key("enabled").MustBool(false)
cfg.GoogleSkipOrgRoleSync = sec.Key("skip_org_role_sync").MustBool(false)
// FIXME: for now we skip org role sync for google auth
// as we do not sync organization roles from Google
cfg.GoogleSkipOrgRoleSync = true
}
func readAuthGitlabSettings(cfg *Cfg) {