首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Grafana oauth与Gitlab

Grafana oauth与Gitlab
EN

Stack Overflow用户
提问于 2021-12-01 13:21:18
回答 1查看 455关注 0票数 0

环境

kube-promethues-stack

  • Grafana版本: 8.2.1部署在GKE上

发生了什么,:我有一个gke集群,gitlab正在运行,并公开了两个入口:一个是内部IP,一个是外部IP。

在第二个集群中,我有一个grafana部署,我想要“连接”到gitlab,以便使用gitlab作为身份验证提供者。由于gitlab的内部url无法从grafana访问,所以我使用外部url,但是有些东西似乎不起作用:在日志中,我看到请求从grafana传递到内部IP,我不明白为什么。这是grafana配置:

代码语言:javascript
复制
    auth.gitlab:
      enabled: true 
      allow_sign_up: true
      scopes: read_api
      auth_url: https://external-url/oauth/authorize
      token_url: https://external-url/oauth/token
      api_url: https://external-url/api/v4

这些是地堑的原木:

代码语言:javascript
复制
t=2021-12-01T12:36:30+0000 lvl=dbug msg="OAuthLogin Got token" logger=oauth token="&{AccessToken:redacted TokenType:Bearer RefreshToken:redacted Expiry:0001-01-01 00:00:00 +0000 UTC raw:map[access_token:redacted created_at:1.637755993e+09 refresh_token:redacted scope:read_api token_type:Bearer]}"
t=2021-12-01T12:36:30+0000 lvl=dbug msg="HTTP GET https://external-url/api/v4/user: 200 OK {redacted information}
t=2021-12-01T12:36:30+0000 lvl=dbug msg="HTTP GET https://external-ip/api/v4/groups: 200 OK {redacted information}
t=2021-12-03T07:20:42+0000 lvl=eror msg=login.OAuthLogin(NewTransportWithCode) logger=context userId=0 orgId=0 uname= error="oauth2: cannot fetch token: 400 Bad Request\nResponse: {\"error\":\"invalid_grant\",\"error_description\":\"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.\"}"
t=2021-12-03T07:20:42+0000 lvl=eror msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/login/gitlab status=500 remote_addr=10.175.1.36 time_ms=58 size=1365 referer=https://EXTERNAL/

t=2021-12-01T12:38:42+0000 lvl=eror msg="Error getting groups from GitLab API" logger=oauth.gitlab err="Get \"https://INTERNAL-URL/api/v4/groups?order_by=name&owned=false&page=2&per_page=20&sort=asc&statistics=false&with_custom_attributes=false\": dial tcp internal-ip:443: connect: connection timed out"
t=2021-12-01T12:38:42+0000 lvl=dbug msg="OAuthLogin got user info" logger=oauth userInfo="&{redacted information}

有人能帮我吗?提前感谢

EN

回答 1

Stack Overflow用户

发布于 2022-02-11 12:14:18

在升级/任何活动之后,gitlab的oauth客户端机密被更改了吗?

我使用Keycloak的oauth,其中可以更改客户端id和客户端秘密,如果更改了,则必须在Grafana的ENV GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET或config oauth_client_secret上更新客户端秘密值。

这是导致我的login.OAuthLogin(NewTransportWithCode)错误的原因。

试着让我知道。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70184968

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档