Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/08/2022 12:08 PM
Hi Team,
I am working on a REST connector (Authentication type as OAUTH). when we try to do a test connection by using below connectionJSON it's throwing below errors.
2022-08-08T18:13:46.397366975Z stdout F 2022-08-08 18:13:46,397 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type JSON_WRITER with this error: Connection refused (Connection refused)
:52:49.20769396Z stdout F org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'groovy.util.ConfigObject@296fc94b' with class 'groovy.util.ConfigObject' to class 'java.util.List' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.List(groovy.util.ConfigObject)
Connection JSON:
{
"authentications":{
"userAuth":{
"authType":"oauth2",
"url":"URL",
"httpMethod":"POST",
"httpParams":{
"Key":"ABCXYZ",
"Id":"12345",
"Secret":"ABCXYZ",
"Resource":"Verity Connect",
"Instance":""
},
"httpHeaders":{
"Content-Type":"application/json"
},
"httpContentType":"application/x-www-form-urlencoded",
"authError":[
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"retryFailureStatuscode":[
401,
403
],
"errorPath":"",
"tokenResponsePath":"Value.value",
"tokenType":"Bearer",
"accessToken":"xyx-123-abc-456"
}
}
}
Postman Request:
Response:
08/08/2022 03:29 PM
{
"authentications":{
"userAuth":{
"authType":"oauth2",
"url":"URL",
"httpMethod":"POST",
"httpParams":{
"Key":"ABCXYZ",
"Id":"12345",
"Secret":"ABCXYZ",
"Resource":"Verity Connect",
"Instance":""
},
"httpHeaders":{
"Content-Type":"application/json"
},
"httpContentType":"application/x-www-form-urlencoded",
"authError":[
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"retryFailureStatuscode":[
401,
403
],
"errorPath":"Value.value",
"tokenResponsePath":"access_token",
"tokenType":"Bearer",
"accessToken":"xyx-123-abc-456"
}
}
}
08/09/2022 04:54 AM
Hello,
Thanks for the reply!
Still facing the below error i.e;
2022-08-09T11:47:05.651273632Z stdout F 2022-08-09 11:47:05,651 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type JSON_WRITER with this error: Connection refused (Connection refused)
08/09/2022 08:29 AM
Can you confirm if above connection working from Postman &share screenshot for same
08/09/2022 12:18 PM
connectionJSON:
{
"authentications":{
"userAuth":{
"authType":"oauth2",
"url":"URL",
"httpMethod":"POST",
"httpParams":"{\"Key\":\"123456789\",\"Id\":\"12345\",\"Secret\":\"xyz123abc456\",\"Resource\":\"Verity Connect\"}",
"httpHeaders":{
"Content-Type":"application/json",
"Accept": "application/json"
},
"httpContentType":"application/json",
"successResponses":{},
"unsuccessResponses":{},
"errorPath":"Code",
"tokenResponsePath":"Value.Value",
"accessToken": "",
"tokenType": "OAuth",
"authHeaderName": "Access-Token"
}
}
}
==============
ImportUserJSON:
{
"connection":"userAuth",
"url":"URL",
"httpMethod":"POST",
"httpHeaders":{
"Access-Token":"{\"Token\": \"${access_token}\"}",
"Accept":"application/json"
},
"httpParams":"{\"Id\":\"1234\"}",
"userResponsePath":"Value.Result",
"colsToPropsMap":{
"username":"id~#~char",
"systemUserName":"id~#~char",
"firstname":"FirstName~#~char",
"lastname":"LastName~#~char"
}
}
Postman Request:
Inside Body
08/09/2022 02:18 PM
ImportUserJSON is not getting access_token from connectionJson
can you try below
ConnectionJson
"retryFailureStatusCode": [],
"maxRefreshTryCount": 5,
"accessToken": "Bearer abcd"