我正试图使Keyclock SSO与嵌入在其中的webapp和Grafana一起工作。
我已经用键钟完成了grafana的整数,并且我能够使用键时钟登录到grafana。但是,当我将grafana作为基础设施嵌入到webapp中,并使用keyclock登录到when应用程序时,错误显示为
login.OAuthLogin(缺失保存状态)
这是我的酒瓶配置
{
"web": {
"issuer": "http://localhost:8080/realms/internal",
"auth_uri": "http://localhost:8080/realms/internal/protocol/openid-connect/auth",
"client_id": "flask",
"client_secret": "nlY4o3kIrReiwwsYo0FrKFDHIZvfdXd5",
"redirect_uris": [
"http://localhost:5000/*"
],
"token_uri": "http://localhost:8080/realms/internal/protocol/openid-connect/token",
"token_introspection_uri": "http://localhost:8080/auth/realms/internal/protocol/openid-connect/token/introspect",
"userinfo_uri": "http://localhost:8080/realms/internal/protocol/openid-connect/userinfo"
}
}下面是我的grafana配置
[auth.generic_oauth]
enabled = true
name = OAuth
allow_sign_up = true
client_id = grafana
client_secret = CA6OIr8z9v3ZPY4yhPWMSwZWJIPWaRK7
scopes = openid email profile
;email_attribute_name = admin@test.com
;email_attribute_path = admin@test.com
auth_url = http://localhost:8080/realms/internal/protocol/openid-connect/auth
token_url = http://localhost:8080/realms/internal/protocol/openid-connect/token
api_url = http://localhost:8080/realms/internal/protocol/openid-connect/userinfo
;allowed_domains =
;team_ids =
;allowed_organizations =
role_attribute_path = "contains(roles[*], 'Admin') && 'Admin' || contains(roles[*], 'Editor') && 'Editor' || 'Viewer'"
;tls_skip_verify_insecure = false
;tls_client_cert =
;tls_client_key =
;tls_client_ca =对于cookie和嵌入,我有以下设置
cookie_samesite = lax
allow_embedding = true我得到了一个500度的错误

发布于 2022-11-08 23:08:10
SameSite=Lax:仅在第三方上下文中发送cookie (意味着地址栏中的URL与cookie域匹配)。不要将其与以下跨源请求一起发送:非获取、AJAX、iframe、图像请求等。它可以将用户从跨站点请求伪造中保存下来。
因此,Lax正在阻止cookie在用例中的“传播”。在这种情况下,None是cookie_samesite Grafana配置的更好选择。
https://stackoverflow.com/questions/74361495
复制相似问题