遵循此文档后:https://grafana.com/docs/grafana/latest/auth/google/
我可以使用谷歌oauth2连接到我的grafana,现在我希望我的用户只有在他是谷歌某个小组的成员时才能连接,这可能吗?
所以最后你会得到这样的东西:
[auth.google]
enabled = true
client_id = CLIENT_ID
client_secret = CLIENT_SECRET
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token
allowed_domains = mycompany.com mycompany.org
allow_sign_up = true
allowed_groups = google-admins devs
否,[auth.google]
不支持授权。
更好的方法是使用具有正确配置的角色映射(可以使用组(和role_attribute_strict = true
的[auth.generic_oauth]
。