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

DUO Rest API Account import failure

jralexander137
New Contributor II
New Contributor II

I have the following api config for import account json using a rest api connection.

 

{
  "connection": "acctAuth",
  "processingType": "SequentialAndIterative",
  "successResponses": {
    "statusCode": [
      200,
      201,
      202,
      203,
      204,
      205
    ]
  },
  "url": "https://api-test.duosecurity.com/admin/v1/users",
  "httpMethod": "GET",
  "httpHeaders": {
    "Authorization": "${access_token}"
  },
  "userResponsePath": "response",
  "colsToPropsMap": {
    "accountID": "user_id~#~char",
    "name": "username~#~char",
    "displayName": "realname~#~char",
    "customproperty4": "email~#~char",
    "customproperty5": "username~#~char",
    "comments": "username~#~char",
    "customproperty7": "notes~#~char",
    "customproperty9": "realname~#~char",
    "customproperty14": "status~#~char"
  },
  "entitlementParams": {
  },
  "acctEntParams": {
    }
}

 

I am getting the following error: 

Error Failed to import dataCannot get property 'processingType' on null object
12 REPLIES 12

SB
Saviynt Employee
Saviynt Employee

Can you try with the below once and  see if it works

{
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"successResponses": {
"statusCode": [
200,
201,
202,
203,
204,
205
]
},
"url": "https://api-test.duosecurity.com/admin/v1/users",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"userResponsePath": "response",
"colsToPropsMap": {
"accountID": "user_id~#~char",
"name": "username~#~char",
"displayName": "realname~#~char",
"customproperty4": "email~#~char",
"customproperty5": "username~#~char",
"comments": "username~#~char",
"customproperty7": "notes~#~char",
"customproperty9": "realname~#~char",
"customproperty14": "status~#~char"
},
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Roles": {
"entTypeOrder": 0
}
}
}
}


Regards,
Sahil

Vajra
New Contributor III
New Contributor III

Sahil,

 

I tried with the above JSON , but no luck in 5.5v. can you able to tell whats going wrong.

SB
Saviynt Employee
Saviynt Employee

What is the error you see in logs.

You can also update ConfigJSON param in the REST connection with value {"showLogs":true} to display additional logs.


Regards,
Sahil

Vajra
New Contributor III
New Contributor III

no logs are displayed though... its not working

Vajra
New Contributor III
New Contributor III

is this working in 5.5v?

 

SB
Saviynt Employee
Saviynt Employee

@jralexander137 Was this issue resolved with the JSON shared.


Regards,
Sahil

SB
Saviynt Employee
Saviynt Employee

@Vajra You should see a thread  with the keyword (DEBUG rest.RestProvisioningService) when you run the job. Can you check for this and then follow the thread to find the error.


Regards,
Sahil

Vajra
New Contributor III
New Contributor III

RestProvisioningService - Got Webservice API Response: [headers:[Server: Duo/1.0, Date: Tue, 13 Jun 2023 17:02:02 GMT, Content-Type: application/json, Content-Length: 73, Connection: keep-alive], responseText:{"code": 40101, "message": "Missing request credentials", "stat": "FAIL"}, cookies:[], statusCode:401]

SB
Saviynt Employee
Saviynt Employee

@Vajra This is a 401 error and it looks like an issue with your connection JSON. Can you check the same and fix it. Below is the link to the REST Guide you can refer to for examples of JSON Construction and Developers Handbook if needed.

https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm


Regards,
Sahil

Vajra
New Contributor III
New Contributor III

Yes based on this the connection is setup. Just posting the Connection details

{
"authentications": {
"acctAuth": {
"authType": "BasicWithHmac",
"url": "https://api-0dcd3a05.duosecurity.com",
"httpMethod": "POST",
"properties": {
"IKEY": "<<ikey value>>",
"SKEY": "<<skey value>>"
},
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic REkyTU82MFpNOEpLVzJLQUdHM0I6bXVZdkllYjFmblk2Q2ZVMDF6TzI5ZXBzSmtEYWdzNmwyUExsRTBqWA=="
}
}
}

 

access token was picked up from header from the postman based on basic auth with ikey -username and skey as password.

Vajra
New Contributor III
New Contributor III

Any update , in 5.5v REST connection is always successful...however import doesnt work and throws the above error

SB
Saviynt Employee
Saviynt Employee

Connection JSON does not really validate the credentials to check if the calls is successful or not unless it is Oauth2 type. And even for Oauth, you need to define the additional parameters in Connection JSON. Refer below for the same

https://docs.saviyntcloud.com/bundle/REST-v55x/page/Content/Developers-Handbook.htm

From the error it does appear to be an issue with Connection JSON. To rule out the issue with the Import JSON, can you generate the Access token from Postman and add the same in your JSON. You can also refer to the above link to find examples of you the Connection JSON to match the format.


Regards,
Sahil