我试过了: url="https://{localhost}/auth/admin/realms/{realm_name}/groups/{group_id}/role-mappings“payload={"id":"role_id","name":"Role_name","composite":"false","clientRole":"true","containerId":"client_id"}
但是,它不工作,我认为它可能与错误的有效载荷有关任何想法请
发布于 2020-09-18 23:45:35
我们可以使用python-keycloak lib:https://pypi.org/project/python-keycloak/有一个函数: assign_group_client_roles
发布于 2020-09-19 04:10:12
格式是正确的,但您要确保客户端具有可用的有效负载角色。这是一个例子,"Hr“组为"RomoteApp”客户端添加了"tile“角色。
在Keycloak UI中,@ Client > RemoteApp > Roles
角色名称
time limit
组> hr客户端角色: RemoteApp可用角色:时间限制已分配角色:尚未包括“时间限制”
邮递员推荐的帖子-由于stan overflow http://127.0.0.1:8080/auth/admin/realms/Test-realm/groups/9efef6bf-7edb-496e-bc0d-a8d4f5f4e3a9/role-mappings/clients/60a19179-f244-42f8-9950-04f2119a4e5b?client=RemoteApp&id=60a19179-f244-42f8-9950-04f2119a4e5b&realm=Test-realm级别较低,我还不能附加图像
在带有行JSON选项的邮递员的正文中( Content-Type : application/json )
[
{
"id": "e17f9f7f-62dc-4998-b058-49b845ff5cef",
"name": "time limit",
"description": "time limit",
"composite": false,
"clientRole": true,
"containerId": "60a19179-f244-42f8-9950-04f2119a4e5b"
}
]
组列表
{
"id": "9efef6bf-7edb-496e-bc0d-a8d4f5f4e3a9",
"name": "hr",
"path": "/hr",
"subGroups": []
}
客户端列表
{
"id": "60a19179-f244-42f8-9950-04f2119a4e5b",
"clientId": "RemoteApp",
...
}
我也不记得令牌端点w/ grant_type调用的访问令牌是password
http://127.0.0.1:8080/auth/realms/Test-realm/protocol/openid-connect/token
https://stackoverflow.com/questions/63927138
复制相似问题