我想通过邮递员中的api向特定客户端密钥斗篷中的用户添加角色,但出现“错误”:“找不到客户端” 这个网址: 开机自检 http://localhost:8080/auth/admin/realms/ {realmName} / users / {userId} / role-mappings / clients / {clientId}
这个身体
{
"roles": [
{
"id": "0830ff39-43ea-48bb-af8f-696bc420c1ce",
"name": "confirm-kilid-user",
"description": "${role_uma_authorization}",
"composite": false,
"clientRole": true,
"containerId": "344e7c81-e7a2-4a43-b013-57d7ed198eee"
}
]
}
答案 0 :(得分:0)
此卷曲有效。作为containerId我们应该给clientId(“ a48108f0-8465-4f91-8a90-39c72f1a05b8”)和作为id我们应该给roleId(“ 36c11a6e-a43a-427c-9c28-90352b369d79”)
卷曲-X POST \ http://localhost:7600/auth/admin/realms/adanic/users/4cf43901-663a-4796-bca7-fdfb8642476d/role-mappings/clients/a48108f0-8465-4f91-8a90-39c72f1a05b8 \ -H'接受: / '\ -H'Accept-Encoding:gzip,deflate'\ -H '授权:承载eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtNnlDZ1ZsbVZRbW5QSmo2UC14Vm1rdG84dnVKNVdhSnlqNTR6d1llSHk0In0.eyJqdGkiOiJjY2U3YTVjNy03YTRmLTQ2ODktYTM2Zi03YjkyOTJhNjlkY2EiLCJleHAiOjE1Nzc1OTg4NDgsIm5iZiI6MCwiaWF0IjoxNTc3NTEyNDQ4LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojc2MDAvYXV0aC9yZWFsbXMvbWFzdGVyIiwic3ViIjoiYzJmOGQwYTctZDYyOC00OWEwLWFhZTUtNzdiMDBkMzRkNjQ4IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiYWRtaW4tY2xpIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiN2Q4OThhZjAtN2FkMS00YzVkLTgwNmQtOWQwMTNlNDEwMjY0IiwiYWNyIjoiMSIsInNjb3BlIjoicHJvZmlsZSBlbWFpbCBwaG9uZSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoiYWRtaW4ifQ.IZ9mx-05mNU2UOvKDXjLbiSbbpoVV7sTKeXAzY7bLbduYApDA9vRsOkUCLB_2Hhdj53Fjp_DxoMKkRsc-D4GIbTTBpKEmB65cH8xsKlt-Ne9vMLW5n_SZRaptTysUHPSfh-NxlUSFwAjXyYp2cH1TQBmUVW3czF1b_8i8b3KAIheq7VLyZcQ8mUTTli1egHlUNLOoqmQO3BEU-fcaI4SPfMHZ4pDWYfFHUJ3B1-be1MTCaVT3LVZKpi7spb-H_o3zmRJnLQdxDqG0-BAIBsytaq6vQ1gf4wzQAzbTvT5VB8FnyRkWID8vum4MW_3XfjABPS2_j1F2cs7Grh7xYd2ew' \ -H'缓存控制:无缓存'\ -H'连接:保持活动状态'\ -H“内容长度:285” \ -H'内容类型:application / json'\ -H'主机:localhost:7600'\ -H'用户代理:PostmanRuntime / 7.20.1'\ -H'cache-control:no-cache'\ -d'[ { “ id”:“ 36c11a6e-a43a-427c-9c28-90352b369d79”, “ name”:“ test”, “ description”:“ $ {role_create-client}”, “ composite”:否, “ clientRole”:是的, “ containerId”:“ a48108f0-8465-4f91-8a90-39c72f1a05b8” } ] '