REST -Add access- URL -Illegal character in path

IAM_99
Regular Contributor II
Regular Contributor II

Hi ,

We are calling below URL on 'Add Access' , its throwing "java.lang.IllegalArgumentException: Illegal character in path at index 40:" this comes at $ (posiiton),

https://xxxxxxx/api/v1/products/${entitlementValue.customproperty1}/users

 

I have tried below  but no luck.

https://xxxxxxx/api/v1/products/${encodeURIComponent(entitlementValue.customproperty1)}/users

Can any one give inputs whats wrong here.

 

16 REPLIES 16

Hemanath
Saviynt Employee
Saviynt Employee

Hi @IAM_99 ,

what type of value hold by customproperty1?. is it having any special char or spaces in between?

if you wish to endcode the  value use  "https://xxxxxxx/api/v1/products/${java.net.URLEncoder.encode(entitlementValue.customproperty1,java.nio.charset.StandardCharsets.UTF_8.toString())}"

Thanks,

Hemanath J

IAM_99
Regular Contributor II
Regular Contributor II

Its String value, no spaces  this is the actual value  : 6603028474658293963

IAM_99
Regular Contributor II
Regular Contributor II

its the same exception - some how its not able to evaluate from $onwords

Got Webservice API Response: [error:Error Illegal character in path at index 40: https://xxxxx.xx.xx/api/v1/products/${java.net.URLEncoder.encode(entitlementValue.customproperty1,java.nio.charset.StandardCharsets.UTF_8.toString())}/users

Hemanath
Saviynt Employee
Saviynt Employee

can you add complete log here

IAM_99
Regular Contributor II
Regular Contributor II

PFA.

Hemanath
Saviynt Employee
Saviynt Employee

can you try making call with https://xxxxx.xx.xx/api/v1/products/${entitlementValue.customproperty1

don't  add /users after ${entitlementValue.customproperty1

Thanks,

Hemanath J

IAM_99
Regular Contributor II
Regular Contributor II

tried already , Its the same wherever  $ start it gives that exception. 

IAM_99
Regular Contributor II
Regular Contributor II

PFB, same exception

Illegal character in path at index 40: https://xxxxxxx.xxx.xx/api/v1/products/${entitlementValue.customproperty1}\u001b[m\n","stream":"stdout","

IAM_99
Regular Contributor II
Regular Contributor II

Could you elaborate more on this, i am not able to make difference ( v1 is the valid url  we dont have v2)

"url": "https://xxxxxx/api/v2/users/${entitlementValue.customproperty1}" 

or 

"url": "https://xxxxxx/api/v1/users/${entitlementValue.customproperty1}" 

 

Issue is  happening from  $      ( ${entitlementValue.customproperty1  is not able to resolve )

Hi @IAM_99 

The same issue is being addressed via the forums here as well:

https://forums.saviynt.com/t5/identity-governance/url-encode-for-entitlementvalue-entitlement-value/...

@sudeshjaiswal @Hemanath FYI

Thanks

Darshan

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @IAM_99 ,

Can you please share the  JSON?

Thanks,

IAM_99
Regular Contributor II
Regular Contributor II

PFB

{
"accountIdPath": "accountName",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://xxxxxxx.aha.io/api/v1/products/${entitlementValue.customproperty1}/users",
"httpMethod": "POST",
"httpParams": "{\"user\": {\"email\": \"${user.email}\",\"first_name\": \"${user.firstname}\", \"last_name\": \"${user.lastname}\" , \"role\": \"${entitlementValue.entitlementID}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"

},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200, 201
]
}
}]
}

Hemanath
Saviynt Employee
Saviynt Employee

Hi @IAM_99 ,

above shared is for add account or add access json?

Thanks,

Hemanath J

IAM_99
Regular Contributor II
Regular Contributor II

Hi Hemanht,

above is Create Account JSON, below is Add Access JSON

 

{
"call": [{
"name": "product_roles",
"connection": "userAuth",
"entVal": "${entitlementValue.customproperty1}",
"url": "https://xxxxxx.aha.io/api/v1/products/${entitlementValue.customproperty1}/users",
"httpMethod": "POST",
"httpParams": "{\"user\": {\"email\": \"${user.email}\",\"first_name\": \"${user.firstname}\", \"last_name\": \"${user.lastname}\" , \"role\": \"${entitlementValue.entitlementID}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [204, 200, 201]
}
}]
}

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @IAM_99,

As @Darshanjain Mentioned in the Forum Post , You were using this in creating account json and the binding variables ${entitlementValue.*} is only exposed in add access json. Here the system is calling the create account as the account is not present hence it is throwing an error.

Only User and account objects are exposed in Create account json , so please create the jsons and modify accordingly as per your use case.

Thanks