【问题标题】:Authentication Grafana via JWT通过 JWT 验证 Grafana
【发布时间】:2021-06-29 12:05:14
【问题描述】:

我是 grafana 的新手,我想使用 grafana 文档中描述的 JWT 身份验证:https://grafana.com/docs/grafana/latest/auth/jwt/ 我一般如何使用 JWK 与外部身份提供者进行身份验证? 具体来说,我必须使用哪个 jwts 端点,它是我的提供商的主要基本网址吗?然后是提供的http auth header?

我的 grafana.ini 配置文件:

[auth.jwt]
enabled = true
header_name = X-JWT-HEADER
cache_ttl = 60m
jwk_set_url = https://$AUTH-PROVIDER-URL/
username_claim = user
email_claim = email

重新启动 grafana 服务器后,我的 grafana 登录页面没有任何变化,我仍然只能使用管理员用户登录。这应该适用于这样的配置还是我错过了什么?

【问题讨论】:

标签: jwt grafana


【解决方案1】:

请注意,auth.jwt 目前已被设计破坏: https://github.com/grafana/grafana/issues/8198

即使您做对了所有其他事情,也需要您在 grafana 中预先填充所有帐户。它应该提供与 auth.proxy 中提供的自动注册类似的功能 auth.jwt 的整个论点是提供与 auth.proxy 类似但更安全的东西: https://cloud.google.com/iap/docs/identity-howto

【讨论】:

    【解决方案2】:

    @Ying.Zhao

    由于缺少 json Web 端点(JWKs url)中的一些声明属性,使用 JWT 的身份验证不起作用。 或者,您可以为您的 OAuth 登录使用“auth generic”或 proxy-auth。

    [auth.proxy]
    enabled = true
    # HTTP Header name that will contain the username or email
    header_name = X_HEADER_NAME
    header_property = username
    

    【讨论】:

      猜你喜欢
      • 2021-08-19
      • 2019-07-18
      • 2020-10-09
      • 2022-11-30
      • 2022-12-23
      • 2016-09-20
      • 2016-06-25
      • 2018-03-03
      • 2019-06-05
      相关资源
      最近更新 更多