我有一个keycloak docker容器(拉出的图像jboss / keycloak)和一个Django 2.2 Web容器。登录正常。现在尝试实现注销,尝试完全遵循此处描述的说明:
https://github.com/marcospereirampj/python-keycloak:
from keycloak import KeycloakOpenID
keycloak_openid = KeycloakOpenID(server_url="http://<my IP>:8080/auth/",
client_id="<client_id>",
realm_name="<my realm name>",
client_secret_key="<my secret>",
verify=True)
config_well_know = keycloak_openid.well_know()
token = keycloak_openid.token("<username>", "<password>")
print(token) # all tokens returned ok
userinfo = keycloak_openid.userinfo(token['access_token'])
print ("userinfo:", userinfo) # userinfo returned ok
keycloak_openid.logout(token['refresh_token'])
在容器日志中:Some clients have been not been logged out for user <username> in <my realm name> realm: <client_id>
没有注销发生,仍然可以浏览站点。
缺少什么?谢谢
我曾经遇到过同样的问题。帮助的是
admin
页面并在realm
中定位您的用户networks
sessions
选项卡,然后单击log out
希望这会有所帮助!