环境
kube-promethues-stack
发生了什么,:我有一个gke集群,gitlab正在运行,并公开了两个入口:一个是内部IP,一个是外部IP。
在第二个集群中,我有一个grafana部署,我想要“连接”到gitlab,以便使用gitlab作为身份验证提供者。由于gitlab的内部url无法从grafana访问,所以我使用外部url,但是有些东西似乎不起作用:在日志中,我看到请求从grafana传递到内部IP,我不明白为什么。这是grafana配置:
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这些是地堑的原木:
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}有人能帮我吗?提前感谢
发布于 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)错误的原因。
试着让我知道。
https://stackoverflow.com/questions/70184968
复制相似问题