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

Rest Connection Using JWT

rajeshg
New Contributor
New Contributor

Hi All,

We have a requirement to integrate the Helix application with REST API. But while importing we are getting the status null and 401 error.

Can you someone guide if anyone worked on JWT token. Please refer below connection and import JOSN:

Connection:

{
"authentications": {
"user": {
"authType": "BasicWithAccessToken",
"url": "https://URL/api/jwt/login",
"httpMethod": "POST",
"httpHeaders": {
"Accept": "application/json"
},
"httpParams": {
"username": "ABCD",
"password": "*********"
},
"properties": {
"username": "ABCD",
"password": "*******"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"retryFailureStatusCode": [
403,
401,
417,
500
],
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "",
"tokenType": "AR-JWT",
"accessToken": "AR-JWT xyz"
}
}
}

Import JSON:

{
"accountParams": {
"unsuccessResponses": {
"message": "",
"response": "",
"statusCode": [
null,
400,
401,
403,
404,
405,
409,
429,
500,
503
]
},
"connection": "user",
"includeExistingInActiveAccounts": true,
"doNotChangeIfFailed": true,
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"deleteLinks": false,
"accountThresholdValue": 30,
"correlateInactiveAccounts": false,
"inactivateAccountsNotInFile": false,
"deleteAccEntForActiveAccounts": true
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "URL",
"httpHeaders": {
"Authorization": "AR-JWT${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "entries",
"keyField": "accountID",
"colsToPropsMap": {
"name": "values.PeopleSyncID~#~char",
"accountID": "values.PeopleSyncID~#~char",
"customproperty1": "ACEJobCode~#~char"
}
}
}
}
}

Note; Due to some issue log viewer is not working and we have raised separate ticket to support.

Error:

Error while getting Account Import Response WebService call failed with responseStatusCode null Failed url-https://URL) with Error Message-null

Error while getting Account Import Response WebService call failed with responseStatusCode 400  Error Failed url-https://URL with Message-{ "servlet":"org.eclipse.equinox.http.servlet.HttpServiceServlet-462abec3", "message":"[ERROR (149): A user name must be supplied in the control record]", "url":"/api/arsys/v1/entry/:SYNC:PPL:Staging", "status":"400" }

 

 

5 REPLIES 5

KhalidAkhterIGA
New Contributor II
New Contributor II

Hi,

Please try with below ConnectionJSON with correct credentials.

{
  "authentications": {
    "user": {
      "authType": "oauth2",
      "url": "https://URL/api/jwt/login",
      "httpMethod": "POST",
      "httpHeaders": {
        "Accept": "application/json"
      },
      "httpParams": "{\"username\": \"ABCD\",\"password\": \"*********\"}",
      "httpContentType": "application/x-www-form-urlencoded",
      "expiryError": "ExpiredAuthenticationToken",
      "retryFailureStatusCode": [
        403,
        401,
        417,
        500
      ],
      "authError": [
        "InvalidAuthenticationToken",
        "AuthenticationFailed",
        "Authentication_MissingOrMalformed",
        "Authentication_ExpiredToken"
      ],
      "timeOutError": "Read timed out",
      "errorPath": "error.code",
      "maxRefreshTryCount": 5,
      "tokenResponsePath": "",
      "tokenType": "AR-JWT",
      "accessToken": "AR-JWT xyz"
    }
  }
}

rushikeshvartak
All-Star
All-Star

Can you share postman curl code 

Please share curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

rajeshg
New Contributor
New Contributor

Hi Khalid,

Thanks for your info. We tried with the JSON and connection is successful from saviynt. When we run the import job its not reaching the target.

Share logs 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

rajeshg
New Contributor
New Contributor

Hi Rushikesh,

Pleas echeck below curl command details.

 

curl --location 'https://ClientName-dev-restapi.onbmc.com/api/jwt/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic eyJhbxyzzacedsws1NiJ9.e30.zUqcpxWbmBNu7rSAtGujnL07_SzdBYIamyI_nPqi7mw' \
--header 'Cookie: AR-JWT=eyJhbGciOiJIUzI1NiJ9.eyJzdaswedcvfrtgbiIhPSF7ZW5jfSE9IUFBQUFETEVpaWU3NGRTcldJQ2xLWklPSWIzL3A0eU9ndEJRcU16S09hQjYrMnZRcmJsTEYiLCJfbG9jYWxlTGFuZ3VhZ2UiOiJlbiIsIm5iZiI6MTcwNTMyMTE5NSwiaXNzIjoicGxhdGZvcm0taW50LTAucGxhdGZvcm0taW50IiwiX2xvY2FsZUNvdW50cnkiOiJVUyIsIl9hdXRoU3RyaW5nIjoiIT0he2VuY30hPSFBQUFBRExFaWllNzRkU3JXSUNsS1pQc29Nd3k2cjdyWDZwcW1TdzZvYUdFPSIsImV4cCI6MTcwNTMyNDkxNSwiX2NhY2hlSWQiOjE0NDQ1OTYsImlhdCI6MTcwNTMyMTMxNSwianRpIjoiSURHR05aSkJINVNJUUFTSDBZMjlTSDBZMjlUU1g1IiwiX2Fic29sdXRlRXhwaXJhdGlvblRpbWUiOjE3MDU0MDc3MTV9.mXuFhw7LSP-3H9Nt8cV1uwwcJ4GZ2tRhFuN8SEY-5GE; _cacheId=1410209; onbmc_pool=!yFWHqNkFeSRFOpYyj6Mwess3vM3mAVaffl5o9zxwogF9dMjSOEjyD02CfMYeCtL68JIjSIjGzdvHH8lI=; route=1704987624.537.106386.531104' \
--data-urlencode 'username=uname' \
--data-urlencode 'password=passwd'

Note: We have changed the customer info.

Regards,
Rajesh