and more in a single search tool across platforms. Read the announcement here. |
04/21/2023 05:49 AM
Hello.
We are currently using version Saviynt v5.5SP3.16
We are trying to call the getRoles API to retrieve a list of roles.
It seems that the call to the API will always append the produced statement in Saviynt with the
Solved! Go to Solution.
04/21/2023 06:00 AM
Hi @Georgios
It looks like the query is set from global config page, you can go to below path and change it if needed
Global confif > Role request > Role request query
Thanks
Darshan
04/21/2023 06:27 AM
Thank you Darshan.
I have cleaned up completely the global config page but I still get the same issue.
Here is an extract from the log where the query tries to retrieve the roles of the user I used to create the connection token..
DEBUG services.UsersService - Parameters are [user_name:"here is the username of the person I want to retrieve the roles from", controller:restfulv5, action:getRoles, max:50, useTokenUser:true, useRolesLabels:true, useEntLabels:true, useUserLabels:true, isFromV5:true, isWS:true, username:"the username of the token connected user"]
DEBUG services.UsersService - Query is Select r from Roles r where r.id in (select rolekey from Role_user_account where userkey = 'XXX')
DEBUG services.UsersService - Total Num of Roles Returning of Current API call = 0
04/21/2023 06:33 AM - edited 04/21/2023 06:34 AM
I just found out that I have been calling the rest api as follows:
https://{url}/ECM/api/v5/getRoles
When I call it as follows, I get the correct results..
https://{url}/ECM/api/getRoles
Any recommendation if we have to use the ECM/api/ instead of ECM/api/v5 path?
04/21/2023 08:02 AM
For Saviynt 5.5 SP3.X , I believe we should use /ECM/api/v5/getRoles
Thanks
04/21/2023 08:16 AM
Hi @Georgios
Yes, that works but you should be using api/v5/ path.
can you check if this config is enabled in externalconfig.properties file of your env
(api.token.usercontext=true)
Thanks
Darshan
04/24/2023 01:17 AM
Thank you Darshan.
The configuration is enabled as you describe in the file, but we are still getting no results when calling the API (ECM/api/v5/getRoles)
{
04/24/2023 01:43 AM
Hi @Georgios
Okay the above config should be false. ( if its true then it will only fetch for the user from whom the token was fetched irrespective of what you give in the body ).
Make the config as false and do a restart of services, you should be good to go.
Thanks
Darshan
04/24/2023 02:48 AM
Thank you Darshan.
It seems that setting the value to false allowed me to get back results when calling the API.
The behavior of the system if I have the whole parameter commented out is different to the one when having the value set as false.
In any case it seems that it is working now. I will test it also to the rest of our environments.
Thanks again.
Georgios