格式正确,但您确保客户端具有可用的有效负载角色。
这是“Hr”组添加“RomoteApp”客户端“tile limit”角色的示例。
在 Keycloak UI 中,@Client > RemoteApp > Roles
角色名称
time limit
组 > 小时
客户端角色:RemoteApp
可用角色:时间限制
分配的角色:尚未包括“时间限制”
邮递员的 POST 推荐 - 由于 stan 溢出级别低,我还不能附加图片
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