Cannot add a role to user [message #1779873] |
Mon, 15 January 2018 08:06 |
lin yanghuan Messages: 17 Registered: August 2017 |
Junior Member |
|
|
I want to add a role to user by api, i use the api :
1. POST /authentication/user ----- the admin user login
2. GET /_/users?name={other_user_name}&offset=0&limit=50 ----- get other user id {userId}
3. GET /_/accessinfos?userId={userId}&offset=0&limit=50 ------get accessinfos id {accessInfoId}
4. GET /_/roles?offset=0&limit=50 ------get role id {roleId}
5. POST /_/accessinfos/{accessInfoId}/roles.
body:
{
"roleId": "{roleId}",
"accessInfoId": "{accessInfoId}",
"scopeId": "_"
}
everything is ok, but at 5 step the server response:
<!DOCTYPE html>
<html>
<head>
<title>Kapua</title>
</head>
<body>
<h1>Kapua</h1>
<p>Error 403: The request was a valid request, but the server is refusing to respond to it.</p>
</body>
</html>
i can add role to user in console and delect it role by api, but cannot add it. how can i do?
[Updated on: Mon, 15 January 2018 10:18] Report message to a moderator
|
|
|
|
Re: Cannot add a role to user [message #1779884 is a reply to message #1779881] |
Mon, 15 January 2018 10:16 |
lin yanghuan Messages: 17 Registered: August 2017 |
Junior Member |
|
|
Milan Ggg wrote on Mon, 15 January 2018 10:00Hello.
Maybe you don't have right permissions for your user to get roles info.
Can you try to do authentication with kapua-sys / kapua-password credentials, and try again?
And if I understood you correctly, you want to add a role tu user from api, not console? I am not sure if that is possible.
Regards,
Milan
Comtrade Digital services
I have a problem at 5 step.
I sure have permissions ,because i use save admin user in console can add role to other user. I also can delete it from api, but cannot add.
yes, I want to add a role to user from api, i think it is possible, just the api not work.
[Updated on: Mon, 15 January 2018 10:19] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01623 seconds