Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/14/2024 10:39 AM
Hi Team,
When we call https://***/SecurityService/UpdateUser this api is adding entitlement to account.
{
"Id": 24653,
"Groups":[ {"Id": 871}]
}
24653 is account id
871 is entitlement id
But when we try to add another group, old group is getting removed from account and new entitlement is getting added.
{
"Id": 24653,
"Groups":[ {"Id": 102}]
}
But when we pass old entitlements id's along with new entitlements this is working fine.
Is there a way we can pass new entitlement along with existing entitlements in api.
getUser Info:
{
"Id": 24653,
"FullName": "User61, Test61",
"Username": "test_user_0061",
"Active": true,
"Locked": false,
"Deleted": false,
"AccountType": 1,
"FirstName": "Test61",
"MiddleName": "",
"LastName": "User61",
"Title": "",
"Language": 1033,
"EmailAddress": "test@test.com",
"HomePhone": "",
"WorkPhone": "",
"MobilePhone": "",
"Fax": "",
"IsSAML": true,
"IsLDAP": false,
"SecurityConfiguration": {
"Id": 7,
"DisplayName": "Standard User Configuration"
},
"APIAccess": false,
"Groups": [
{
"Id": 871,
"Name": "test test Support"
},
{
"Id": 872,
"Name": "test test Support1"
}
],
"SecurityRoles": [
{
"Id": 12,
"Name": "CM_Awareness_User"
}
],
"FunctionalRoles": []
}
08/14/2024 10:41 AM
08/23/2024 10:13 AM
@rushikeshvartak / All,
Thanks for reviewing this.
I tried to fallow the given forum link.
But from call1 response we are getting is as fallow.
{
"Id": 24653,
"Groups":[ {"Id": 102},{"Id": 103}]
}
I have tried to render the values but alwasy getting error like
","DEBUG","Exit encryptHeaders"
"2024-08-14T19:14:53.321+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-8-8vmjf","DEBUG","Task Res"auditDetails":{"Groups":[{"message":"Unrecognized token '$': was expecting ('true', 'false' or 'null')\n at [Source: {\"Id\": \"${account.accountID}\",\"Groups\":[${List roleNameList = response.call1.message.Groups.collect{it.toString()}; roleNameList.add(entitlementValue.entitlement_value.toString());String rolesStr = roleNameList.toString().replace('[','').replace(']','').replace('\"','');return rolesStr;}]}; line: 1, column: 42]","status":"Failed"}]},"Groups":{"message":"Unexpected character ('L' (code 76)): was expecting double-quote to start field name\n at [Source: {\"Id\": \"24654\",\"Groups\":[{List roleNameList = response.call1.message.Groups.collect{it.toString()}; roleNameList.add(entitlementValue.entitlement_value.toString());String rolesStr = roleNameList.toString().replace('[','').replace(']','').replace('\"','');return rolesStr;}]}; line: 1, column: 28]","status":"Failed"}}"
"2024-08-14T19:14:53.321+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-8-8vmjf","DEBUG","Result: false"
08/23/2024 10:57 AM
Please share log file in text file
09/13/2024 11:31 AM
Hi @rushikeshvartak
I have tried making changes to code. But every time getting $ unrecognized error. Logs attached. Few jsons which tried also attached.
Sample response from Call 1:
09/13/2024 11:46 AM
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://****-sandbox.****grc.com:4443/SecurityService/GetGroup?id=${entitlementValue.entitlementID}",
"httpParams": "{}",
"httpHeaders": {
"Cookie": "${access_token}",
"Content-Type": "application/json",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
500,
501
]
}
},
{
"name": "Groups",
"connection": "acctAuth",
"url": "https://****-sandbox.****grc.com:4443/SecurityService/UpdateGroup",
"httpParams": "{\"Id\": \"${entitlementValue.entitlementID}\",\"Users\": [${List responseList = response.call1.message.Users; List filteredRoles = responseList.collect { user -> user.Id != entitlementValue.entitlement_value ? user.Id : null }.findAll { it != null }; filteredRoles.collect { \"${it}\" }.join(',')}]}}",
"httpHeaders": {
"Cookie": "${access_token}",
"Content-Type": "application/json",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
500,
501
]
}
},
{
"name": "call2",
"connection": "acctAuth",
"url": "https://****-sandbox.****grc.com:4443/SecurityService/Logout",
"httpMethod": "GET",
"httpHeaders": {
"Cookie": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
09/16/2024 06:43 AM
Hi @stalluri
Thanks for checking this. I am still getting similar error.
"2024-09-16T13:23:59.383+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-4-d8l6m","DEBUG","Total Call: 1"
"2024-09-16T13:23:59.404+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-4-d8l6m","DEBUG","connection: acctAuth"
"2024-09-16T13:23:59.448+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-4-d8l6m","ERROR","Error in processWebservicecom.fasterxml.jackson.core.JsonParseException: Unrecognized token '$': was expecting ('true', 'false' or 'null')| at [Source: {"Id": "${entitlementValue.entitlementID}","Users": [${List responseList = response.call1.message.Users; List filteredRoles = responseList.collect { user -> user.Id != entitlementValue.entitlement_value ? user.Id : null }.findAll { it != null }; filteredRoles.collect { "${it}" }.join(',')}]}}; line: 1, column: 55]"
"2024-09-16T13:23:59.449+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-4-d8l6m","DEBUG","Enter encryptHeaders"
"2024-09-16T13:23:59.449+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-4-d8l6m","DEBUG","Exit encryptHeaders"
"2024-09-16T13:23:59.450+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-4-d8l6m","DEBUG","Task Response: {"Groups":{"message":"Unrecognized token '$': was expecting ('true', 'false' or 'null')\n at [Source: {\"Id\": \"${entitlementValue.entitlementID}\",\"Users\": [${List responseList = response.call1.message.Users; List filteredRoles = responseList.collect { user -> user.Id != entitlementValue.entitlement_value ? user.Id : null }.findAll { it != null }; filteredRoles.collect { \"${it}\" }.join(',')}]}}; line: 1, column: 55]","status":"Failed"}}"
Any pointers will be great help.
09/16/2024 08:13 AM
@VijayMaram
Can you share the postman CURL when you pass the values?
09/16/2024 08:31 AM
09/16/2024 08:42 AM
Did you validated with hardcoded value
09/16/2024 09:38 AM
{
"httpParams": "{\"Id\": \"${entitlementValue.entitlementID}\",\"Name\": \"API Group\",\"Description\": \"Another API update.\",\"BusinessUnit\": false,\"Users\": [${List responseList = response.call1.message.Users; List filteredRoles = responseList.findAll { it.Id != entitlementValue.entitlement_value }; filteredRoles.collect { \"{\\\"Id\\\": \" + it.Id + \"}\" }.join(',')}],\"ParentGroups\": [{\\\"Id\\\": 2},{\\\"Id\\\": 3}]}"
}
09/16/2024 11:46 AM
Yes, when i tried to pass json as fallow, task getting completed successfully.
"url": "https://****-sandbox.****grc.com:4443/SecurityService/UpdateGroup",
"httpParams": "{\"Id\": \"${entitlementValue.entitlementID}\",\"Users\": [{\"Id\": ${account.accountID}}]}",
OR
"{\"Id\": \"${entitlementValue.entitlementID}\",\"Users\": [{\"Id\": 24654},{\"Id\": 24656},{\"Id\": 24655}]}",
Above both the cases were working fine. Logs for second usecase.
2024-09-16T13:41:58-05:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-8-d8l6m-DEBUG-timeout validated for api...
2024-09-16T13:41:58-05:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-8-d8l6m-DEBUG-got response for api...
2024-09-16T13:41:58-05:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-8-d8l6m-DEBUG-Got showLogs = true
2024-09-16T13:41:58-05:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-8-d8l6m-DEBUG-Got Webservice API Response: [headers:[Cache-Control: no-cache, no-store, must-revalidate, Pragma: no-cache, Content-Type: application/json, Expires: -1, Vary: Accept-Encoding, Server: , Strict-Transport-Security: max-age=31536000; includeSubDomains; preload, X-ASPNET-VERSION: , X-POWERED-BY: , Date: Mon, 16 Sep 2024 18:41:58 GMT], responseText:{| "Id": 871,| "Name": "**** Keylight Support",| "Description": "Membership of this group requires approval from Marqueta Lee, Jerry Lefler, or Ted Keith. **** Keylight Support ",| "BusinessUnit": false,| "LDAPDirectory": {| "Id": 3,| "DisplayName": "RemoteDirectorySync_Sandbox"| },| "LDAPGroupName": "KL_SupportGroup_P",| "LDAPGroupDN": "CN=KL_SupportGroup_P,OU=Keylight Groups,OU=**** Groups,DC=****,DC=com",| "SecurityRoles": [| {| "Id": 5,| "Name": "CM_CDocs_Maintainer"| },| {| "Id": 39,| "Name": "Platform_Config_Read"| },| {| "Id": 115,| "Name": "****_Keylight_Support "| }| ],| "Users": [| {| "Id": 24654,| "FullName": "User49, Test49"| },| {| "Id": 24655,| "FullName": "User65, Test65"| },| {| "Id": 24656,| "FullName": "LU101, TU101"| }| ],| "ChildGroups": [],| "ParentGroups": []|}, cookies:[], statusCode:200]
09/16/2024 11:48 AM
What current issue then ?
09/16/2024 12:32 PM
If we try to add single user to entitlement then api is removing the existing users and adding only the current user.
So we are trying to call the list of user details api for entitlement and trying to add this users list to selected user.
Old list : [{1},{2}]
New list: [{1},{2},{3}]
3 is newly selected user through ARS.
09/16/2024 12:08 PM
@stalluri
Getting error as fallow:
09/16/2024 12:34 PM
Hi @stalluri and @rushikeshvartak
I have tried removing $ from the JSON. Below is the new error i am getting.