Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

REST ERROR Unrecognized token '$' in AddAccessJSON

n1khil
New Contributor III
New Contributor III

Hey Folks,

We are getting Error in the call while trying to push the entitlements, can you let me know where we are doing wrong?

{
"call": [
{
"name": "Group",
"connection": "acctAuth",
"url": "https://xxx/scim/v2/Users/${account.accountID}",
"httpMethod": "GET",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
}
},
{
"name": "Group",
"connection": "acctAuth",
"url": "https://xxx/scim/v2/Users/${account.accountID}",
"httpMethod": "PUT",
"httpContentType": "application/json",
"httpParams": "{ \"schemas\":[ \"urn:ietf:params:scim:schemas:core:2.0:User\",\"urn:ietf:params:scim:schemas:extension:cogniloreuser:2.0:User\" ], \"Active\":\"true\", \"userName\":\"${arsTasks.accountName}\",\"entitlements\" : ${if(response.'Group1'.message.entitlements?.size()>0){ArrayList finalArr = new ArrayList(); ArrayList arr = response.'Group1'.message.entitlements; arr.eachWithIndex{ val, idx -> Map tempMap = new HashMap(); tempMap.put('value', val.value); tempBuilder = new groovy.json.JsonBuilder(tempMap); finalArr.add(tempBuilder.toString()); }; Map map = new HashMap(); map.put('value',entitlementValue.entitlementID); builder = new groovy.json.JsonBuilder(map); finalArr.add(builder.toString()); return finalArr;}else{ArrayList finalArr = new ArrayList(); Map map = new HashMap(); map.put('value',entitlementValue.entitlementID); builder = new groovy.json.JsonBuilder(map); finalArr.add(builder.toString()); return finalArr;}},\"urn:ietf:params:scim:schemas:extension:cogniloreuser:2.0:User\": {\"userEmail\": \"${if(user.email == null) {user.secondaryEmail} else {user.email}}\", \"userID\": \"${user.username}\",\"userFullName\": \"${user.displayname}\",\"employeeType\": \"${requestAccessAttributes.get('Usertype')}\",\"CountryCode\": \"${user.customproperty3}\", \"userLocation\": \"${requestAccessAttributes.get('Location')}\",\"userManager\": \"${user.customproperty16}\",\"microsoftOid\": \"${userAccount.get('Azure_AD_PROD').accountID}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"successResponses": {
"statusCode": [
200,
201,
204
],
"status": "Success"
},
"unsuccessResponses": {
"statusCode": [
302,
400,
403,
401,
404,
409,
500,
501
]
}
}
]
}

 

Error is -

 [quartzScheduler_Worker-18] ERROR rest.RestProvisioningService  - Error in processWebservicecom.fasterxml.jackson.core.JsonParseException: Unrecognized token '$': was expecting ('true', 'false' or 'null')
 at [Source: { "schemas":[ "urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:cogniloreuser:2.0:User" ], "Active":"true", "userName":"${arsTasks.accountName}","entitlements" : ${if(response.'Group1'.message.entitlements?.size()>0){ArrayList finalArr = new ArrayList(); ArrayList arr = response.'Group1'.message.entitlements; arr.eachWithIndex{ val, idx -> Map tempMap = new HashMap(); tempMap.put('value', val.value); tempBuilder = new groovy.json.JsonBuilder(tempMap); finalArr.add(tempBuilder.toString()); }; Map map = new HashMap(); map.put('value',entitlementValue.entitlementID); builder = new groovy.json.JsonBuilder(map); finalArr.add(builder.toString()); return finalArr;}else{ArrayList finalArr = new ArrayList();  Map map = new HashMap(); map.put('value',entitlementValue.entitlementID); builder = new groovy.json.JsonBuilder(map); finalArr.add(builder.toString()); return finalArr;}},"urn:ietf:params:scim:schemas:extension:cogniloreuser:2.0:User": {"userEmail": "${if(user.email == null) {user.secondaryEmail} else {user.email}}", "userID": "${user.username}","userFullName": "${user.displayname}","employeeType": "${requestAccessAttributes.get('Usertype')}","CountryCode": "${user.customproperty3}", "userLocation": "${requestAccessAttributes.get('Location')}","userManager": "${user.customproperty16}","microsoftOid": "${userAccount.get('Azure_AD_PROD').accountID}"}}; line: 1, column: 199] 

 

3 REPLIES 3

pruthvi_t
Saviynt Employee
Saviynt Employee

Hi @n1khil ,

Greetings.

From the json and error provided looks like an issue in http params part. Please refer to the below forums post where similar issue was encountered.

https://forums.saviynt.com/t5/identity-governance/rest-error-unrecognized-token-addaccess-json/m-p/5...

Thanks,


Regards,
Pruthvi

n1khil
New Contributor III
New Contributor III

Hey Pruthvi,

But the issue is this was an existing implementation where everything was working fine, all suddenly we started getting this error,

 

Try restarting server


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.