and more in a single search tool across platforms. Read the announcement here. |
03/19/2024 03:09 PM
i am invoking 2 APIs in updateuser json. Am facing issue with second invocation. Call1 am getting the access_token and am unable to pass the token in call2.
CALL1 RESPONSE:
"ERROR","Call response: {"access_token":"eyJ0eXAiOPZja1T6X9WWMs__zM53M3wz2CY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ","expires_in":299,"scope":"rsts:sts:primaryproviderid:local:pwd","success":true,"token_type":"Bearer"}"
"ERROR","callResponseMap: [access_token:eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6InJIc1NFNEhhVlQ3UEJJTEFQMS0wNEVITXRrUSJ9.eyJpc3MiOiJodHRwczovL0FDN0IxMjEzODFEQTU1M0VDRjA0ODJDMDNGNUZCNEUwNDFDQ0I2NDQiLCJuYmYiOjE3MTA4ODMxMTAsImV4cCI6MTcxMDg4MzQxMCwiYXV0aG1ldGCY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ, expires_in:299, scope:rsts:sts:primaryproviderid:local:pwd, success:true, token_type:Bearer]"
CALL2 ERROR:
"DEBUG","Got Webservice API Response: [error:Error Illegal character in path at index 72: https://d/v4/Token/${response.call1.message.access_token}]"
"ERROR","Exception in getting response in pullObjectsByRest :"
"java.lang.Exception: NullResponseFromTarget at
JSON:
{
"actions": {
"Update Login": {
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://ddd/oauth2/token",
"httpMethod": "POST",
"httpParams": "{\"grant_type\":\"password\",\"scope\":\"local\",\"username\":\"dddd\",\"password\":\"dddd\"}",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://d/v4/Token/${response.call1.message.access_token}",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpParams": {},
"successResponses": {
"statusCode": [
200
]
}
}
]
}
}
}
03/19/2024 07:25 PM
Does Call 2 works in postman
Suspecting special characters issue.
03/20/2024 05:07 AM
yes call2 work in postman.
03/20/2024 07:01 AM
anyway possible to fix this? i did tried URLEncode method but no luck
regards,
Sajid
03/20/2024 07:24 AM
Not sure if it makes any difference but you have empty params in call. Also check if the response from call1 is a valid access token that conforms to the standard - https://jwt.io/
03/21/2024 06:12 AM
Falcon, I can see the response in saviynt logs. When you said empty params where did you see that information.
ERROR","Call response: {"access_token":"eyJ0eXAiOPZja1T6X9WWMs__zM53M3wz2CY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ","expires_in":299,"scope":"rsts:sts:primaryproviderid:local:pwd","success":true,"token_type":"Bearer"}" "ERROR","callResponseMap: [access_token:eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6InJIc1NFNEhhVlQ3UEJJTEFQMS0wNEVITXRrUSJ9.eyJpc3MiOiJodHRwczovL0FDN0IxMjEzODFEQTU1M0VDRjA0ODJDMDNGNUZCNEUwNDFDQ0I2NDQiLCJuYmYiOjE3MTA4ODMxMTAsImV4cCI6MTcxMDg4MzQxMCwiYXV0aG1ldGCY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ, expires_in:299, scope:rsts:sts:primaryproviderid:local:pwd, success:true, token_type:Bearer]"
03/20/2024 09:48 PM - edited 03/20/2024 09:49 PM
{
"actions": {
"Update Login": {
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://ddd/oauth2/token",
"httpMethod": "POST",
"httpParams": "{\"grant_type\":\"password\",\"scope\":\"local\",\"username\":\"dddd\",\"password\":\"dddd\"}",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://d/v4/Token/${response.call1.message.access_token}",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json","Authorization": "${access_token}"
},
"httpParams": {},
"successResponses": {
"statusCode": [
200
]
}
}
]
}
}
}
03/20/2024 08:19 AM
I suspect this path.
${response.call1.message
Is this correct path/variable?
03/20/2024 09:38 PM
Set "Authorization": "${access_token}"
03/21/2024 06:05 AM - edited 03/21/2024 06:05 AM
@adarshk, the second call don't need authorization header and the concern was why this variable is not resolving.
In url instead of token I tried scope, token_type just to See if the value getting resolved but it's not resolving.
@rushikeshvartak authorization header is not required for the second call.
@Falcon I to feel the same. I checked in jwt.io and it gets resolved. However if you you look at the response along with token it contains scope and token_type. I even tried with scope and token_type just to see if it's get resolved but no luck. Any idea what's causing it? Today I will try the same json with different APIs just to make sure it's not a json issue.
03/21/2024 06:09 AM
Even though its not needed saviynt every call have set of mandatory fields hence you can’t skip
03/21/2024 06:17 AM
Ha interesting, will update you shortly.
03/21/2024 06:20 AM
@rushikeshvartak out of scope question, for the APIs basically which have different names for authorization header. Example: for okta it's a ststoken.
Now in this case, we have to pass both ststoken header and authorization header ?
03/21/2024 09:35 AM
@adarshk @rushikeshvartak @Falcon
Could you please try this in your test envs. Thanks in advance
===================
Fake APIs available on internet: https://reqres.in/
{
"actions": {
"Update Login": {
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpParams":"{\"name\": \"mm\" }",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
},
{
"name": "call",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "123",
"Content-Type": "application/json"
},
"httpParams": "{\"name\": \"${response.call1.message.id}\" }",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
}
}
03/21/2024 07:18 PM - edited 03/21/2024 07:19 PM
{
"actions": {
"Update Login": {
"call": [
{
"name": "Update Login",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpParams":"{\"name\": \"mm\" }",
"httpHeaders": {
"Content-Type": "application/json","Authorization": "123"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
},
{
"name": "Update Login",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "123",
"Content-Type": "application/json"
},
"httpParams": "{\"name\": \"${response.call1.message.id}\" }",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
}
}