How to retrieve roles for specific user

172 views Asked by At

how could I retrieve all user roles for specific user?

I thought one way could be using this:

curl -v -k --user admin:admin https://x:9443/wso2/scim/Users/x9-4fb9-be82-b1c97c073f02

from https://docs.wso2.com/display/IS530/SCIM+APIs which should return all atributes, but there is not roles inside... when I tried this for example worked and returned all emails of user.

curl -v -k --user admin:admin  https://x:9443/wso2/scim/Users/x9-4fb9-be82-b1c97c073f02?attributes=emails

but when I do this, comma separated retriving of roles, that doesnt work. Maybe it is not considered as attribute?

curl -v -k --user admin:admin  https://x:9443/wso2/scim/Users/x9-4fb9-be82-b1c97c073f02?attributes=emails,roles

I just want to achieve that I will have all user information with request, whether it is for all users or one user with all attributes I have read this https://wso2.org/jira/browse/IDENTITY-4430 issue, but seems like with attributes in url we can fix that

1

There are 1 answers

0
Nilasini On

I have tried the same requests you gave, but it gives the role names under "group". part of the response is as follows:-

"groups":[{"display":<your group(role) name associated with the particular user>,"value":<group_id>}]

Did you assign roles(groups) to the specific user before try the above requests?

And here along with the request you are specifying the user id so the response will give only the particular user information, not all user's information.