grafana

在Authsaur中创建应用

进入应用市场 ,点击 Grafana,填写相关信息。

配置 Grafana

根据你的安装方式,找到 Grafana 的配置文件,可以参考 Grafana 文档。加入如下配置:

[auth.generic_oauth]
enabled = true
name = Authsaur
allow_sign_up = true
;auto_login = false
client_id = grafana-id
client_secret = grafana-secret
scopes = email phone profile openid role
empty_scopes = true
email_attribute_name = umail
email_attribute_path = me
login_attribute_path = me
name_attribute_path = uname
id_token_attribute_name = id_token
auth_url = https://116.205.137.175/oidc/oidcAuthorize
token_url = https://116.205.137.175/oidc/oidcAccessToken
api_url = https://116.205.137.175/oidc/oidcProfile
;allowed_domains =
tls_skip_verify_insecure = true

配置完成重启 Grafana 即可。

体验登录

在 Grafana 中体验登录。

输入邮箱密码登录,注意此处邮箱后缀必须是之前配置的 allowed_domains 中的一个。本示例中配置的为 test.com,登录邮箱为 test@test.com

点击登录即可登录成功。