使用OIDC的Grafana

问题描述

我已关注Grafana文档,但不确定如何使用OpenID connect配置Grafana。 https://grafana.com/docs/grafana/latest/auth/generic-oauth/

我们已经使用OpenID connect配置了几个可以正常运行的应用程序。

我需要配置与Grafana的OpenID连接。

我们所拥有的:

  1. ClientID
  2. 客户秘密
  3. 公开展示Grafana

此外,我们公开展示了Grafana,并应为其配置“ /重定向”。

我们的发行方服务器配置支持以下内容:

“发行人”:“ https://accounts.fds.com”

“ authorization_endpoint”:“ https://accounts.fds.com/oauth2/authorize”

“ token_endpoint”:“ https://accounts.fds.com/oauth2/token”

“ response_types_supported”:[“代码”,“ id_token”,“令牌”]

“ scope_supported”:[“ openid”]

从文档开始此回调URL必须与您在浏览器中用于访问Grafana的完整HTTP地址匹配,但前缀路径为/ login / generic_oauth“ 所以我们也提供了这个,我的问题是我应该进一步做什么,什么是强制性的?

我应该创建一些应用程序还是仅仅是配置任务?

我们正在使用Grafana 7.1

我已经按照以下方式对其进行了配置:

grafana:
  enabled: true
  namespaceOverride: ""
  grafana.ini:
    server:
      root_url: http://a725be449-30559695.eu-central-1.elb.amazonaws.com/
    auth.generic_oauth:
      enabled: true
      client_id: foo_clientid
      client_secret: foo_secert
      scopes: "openid"
      auth_url: https://accounts.fds.com/oauth2/authorize
      token_url: https://accounts.fds.com/oauth2/token
#     api_url: https://${domain}/userinfo. //Not sure what this
      allow_sign_up: true

在“ root_url”字段中,我已放置了指向我们的grafana的链接,该链接重定向到/ login

不确定什么是 API_URL ???,我应该在那提供什么?
部署应用程序时,当我单击时,我看到带有sigh in with oAuth新按钮,我收到错误消息:“ OpenID提供程序无法处理请求,因为配置不正确。请与系统管理员联系。”有什么主意吗?

此外,如果我想配置重定向网址,应该使用哪个属性?

更新

我能够看到重定向正常运行,但是我知道此错误了吗?

enter image description here

解决方法

您使用的OIDC客户端应已配置此重定向URL:

http://a725be449-30559695.eu-central-1.elb.amazonaws.com/login/generic_oauth

Grafana将根据您的grafana.ini配置请求重定向URL。

我希望您知道OIDC需要https协议。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...