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

Error while provisioning the access

adityachadde
New Contributor III
New Contributor III

Hi Team,

We are trying to provision the access using multiple API calls. We are using the below JSON.

 {
"call":[
{
"name":"Group",
"connection":"acctAuth",
"url":"http://URL/groups/${entitlementValue.entitlementID}",
"httpMethod":"GET",
"httpHeaders":{
"Authorization":"${access_token}",
"Content-Type":"application/json"
},
"httpContentType":"application/json"
},
{
"name":"Group",
"connection":"acctAuth",
"url":"http:/url/groups/${entitlementValue.entitlementID}",
"httpMethod":"POST",
"httpParams":"{\"properties\": {\"users_names\": ${response.Group1.message.properties.users_names==null?'[\"'+account.name+'\"]':'[\"'+response.Group1.message.properties.users_names.toString().replace('[','').replace(']','').replace(', ','\",\"')+'\",\"'+account.name+'\"]'}}}",
"httpHeaders": {
"Authorization":"${access_token}",
"Content-Type":"application/json"
},
"httpContentType":"application/json",
"successResponses":{
"statusCode":[
200,
201,
204,
205
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405
]
}
}
]
}

This is working as expected if the group name has no space but we are getting an error if the group name has space.

For Example: for "ade_site_1001_01" group it is working but for "centre de services" group it is not working we are getting an error as below in the provisioning comments:

{"auditDetails":{"Group2":[{"headers":null,"message":"","statusCode":null,"description":null,"status":"Failed"},{"headers":null,"message":"","statusCode":null,"description":null,"status":"Failed"},{"headers":null,"message":"","statusCode":null,"description":null,"status":"Failed"}]},"Group1":{"headers":null,"message":"","statusCode":null,"description":null,"status":"Failed"},"Group2":{"headers":null,"message":"","statusCode":null,"description":null,"status":"Failed"}}

and Below error in the logs:

{"log":"2023-03-17 08:54:15,943 [quartzScheduler_Worker-5] DEBUG println.PrintlnToLogger - Println :: \u001b[1;31m| Error \u001b[22;39mjava.lang.IllegalArgumentException: Illegal character in path at index 96: http://URL/groups/centre de services\u001b[m\n","stream":"stdout","time":"2023-03-17T08:54:15.943844761Z"}

What should we do to resolve this issue?

Is this a Saviynt bug?

Should we raise a saviynt ticket for this.

Please help us with this.  This is a blocker for our development. 

Best Regards,

Aditya Chadde

2 REPLIES 2

DixshantValecha
Saviynt Employee
Saviynt Employee

I appreciate you reaching out to the Saviynt forums.

#The error you are getting is due to the presence of a space character in the group name, which is causing an illegal character in the URL path. To resolve this issue, you can encode the space character in the URL using percent-encoding.

#In your JSON, you can replace the group name in the URL with the encoded version of the name. For example, if the group name is "centre de services", you can replace it with "centre%20de%20services".

#Here's an updated JSON with the encoded group name:

 

{
"call":[
{
"name":"Group",
"connection":"acctAuth",
"url":"http://URL/groups/${encodeURIComponent(entitlementValue.entitlementID)}",
"httpMethod":"GET",
"httpHeaders":{
"Authorization":"${access_token}",
"Content-Type":"application/json"
},
"httpContentType":"application/json"
},
{
"name":"Group",
"connection":"acctAuth",
"url":"http:/url/groups/${encodeURIComponent(entitlementValue.entitlementID)}",
"httpMethod":"POST",
"httpParams":"{"properties": {"users_names": ${response.Group1.message.properties.users_names==null?'["'+account.name+'"]':'["'+response.Group1.message.properties.users_names.toString().replace('[','').replace(']','').replace(', ','","')+'","'+account.name+'"]'}}}",
"httpHeaders": {
"Authorization":"${access_token}",
"Content-Type":"application/json"
},
"httpContentType":"application/json",
"successResponses":{
"statusCode":[
200,
201,
204,
205
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405
]
}
}
]
}

 

#In this updated JSON, the group name in the URL is replaced with ${encodeURIComponent(entitlementValue.entitlementID)}, which is a JavaScript function that encodes the group name using percent-encoding.

Note:-The updated JSON we provided has changed the URL in both the GET and POST requests to include encodeURIComponent(entitlementValue.entitlementID). This ensures that any special characters in the entitlementID are properly encoded in the URL and should resolve the issue you were experiencing with group names that contain spaces.

#Please let me know if  further details are needed on this.

adityachadde
New Contributor III
New Contributor III

Hi @DixshantValecha,

Thank You so much for your help 🙂 this made my day.

Best Regards,

Aditya Chadde