1

我正在使用 keycloak 网守来保护一个简单的前端 Web 应用程序,它运行良好;用户需要在到达实际站点之前登录。

问题是注销。当我使用 /oauth/logout URL 时,它似乎破坏了应用程序中的本地会话,但实际上并没有将用户注销。下次我刷新时,用户再次登录。

我检查了 keycloak 网守日志,每当我点击注销 URL 时,我都会看到这个;

error invalid response from revocation endpoint {"status": 400, "response": "{\"error\":\"invalid_grant\",\"error_description\":\"Invalid refresh token\"}"}

error no session found in request, redirecting for authorization {"error": "authentication session not found"}

info issuing access token for user {"email": "test@test.com", "expires": "2019-11-08T12:11:35Z", "duration": "4m59.409151193s"}

看起来它尝试调用吊销 URL,失败,然后再次登录用户。问题是为什么调用revocation-url 失败。我没有设置任何自定义,这只是 keycloak + keycloak-gatekeeper 开箱即用。

任何人都可以对此有所了解吗?

这是网守配置(部署在 Kubernetes 中);

secure-cookie: false
client-id: dashboard
client-secret: xxx
discovery-url: https://xxx/auth/realms/dashboard
enable-default-deny: true
encryption_key: xxx
listen: 0.0.0.0:3000
redirection-url: https://domain.tld
upstream-url: http://127.0.0.1:80
4

1 回答 1

2

Invalid refresh token=> 您需要启用刷新令牌:

enable-refresh-tokens: true
encryption-key: <your enryption key>
于 2019-11-10T09:58:24.463 回答