Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/14/2024 11:08 AM
Hello All,
We have REST application configured , while running account import job - getting below error in the logs
{"error":"internal_server_error","error_description":"The token was expected to have 3 parts, but got 1."}statusCode:500]"
Here is the ImportAccEntJSON:
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://xxxxxxxxxxx:8442/security/v2.1/domains/Main/applications/tm/users",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"statusConfig": {
"active": "A",
"inactive": "T"
},
"listField": "users",
"keyField": "accountID",
"colsToPropsMap": {
"name": "username~#~char",
"status": "active~#~char",
"accountID": "username~#~char",
"customproperty1": "uid~#~char",
"CUSTOMPROPERTY2": "idp~#~char",
"customproperty3": "ad_domain~#~char",
"CUSTOMPROPERTY4": "nick_name~#~char",
"CUSTOMPROPERTY5": "user_type~#~char"
}
}
}
},
"entitlementParams": {
"entTypes": {
"Roles": {
"entTypeOrder": 1,
"entTypeLabels": {},
"call": {
"call1": {
"connection": "acctAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://xxxxxxxxxxx:8443/v2.1/roles?domainName=Main&applicationName=TM",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "result",
"keyField": "entitlementID",
"colsToPropsMap": {
"description": "description~#~char",
"customproperty3": "elevated_privilege~#~char",
"entitlementID": "id~#~char",
"entitlement_Value": "name~#~char",
"displayname": "name~#~char"
}
}
}
}
}
},
"acctEntParams": {
"entTypes": {
"Roles": {
"call": {
"call1": {
"connection": "acctAuth",
"processingType": "http",
"http": {
"url": "https://xxxxxxxxxxx:8443/v2.1/Users/209",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"listField": "",
"acctKeyField": "accountID",
"entKeyField": "entitlementID",
"acctIdPath": "",
"entIdPath": ""
}
}
}
}
}
}
Note: All access token generation & get users api calls works fine in POSTMAN
Best Regards,sb
Solved! Go to Solution.
06/14/2024 11:33 AM
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️
06/17/2024 10:04 AM - edited 06/17/2024 10:07 AM
Please find below
curl --location 'https://xxxxxxxxx/security/v2.1/user/token' --header 'Content-Type: application/json' --data '{"idp": "xxxx","username":"xxxx","password": "xxxxxxxxx"}'
ConnectionJSON:
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://xxxxxxx/security/v2.1/user/token",
"httpMethod": "POST",
"httpParams": "{\"idp\":\"xxxxxx\",\"username\":\"xxxxxx\",\"password\":\"xxxxxxxx\"}",
"httpHeaders": {
"Accept": "application/json"
},
"httpContentType": "application/json",
"authError": [
"InvalidAuthenticationToken"
],
"errorPath": "error.code",
"maxRefreshTryCount": 2,
"tokenResponsePath": "accessToken",
"tokenType": "Bearer",
"accessToken": "Bearer abc",
"retryFailureStatusCode": [
401
]
}
}
}
Thanks,
06/17/2024 10:09 AM
Does application needs access token or refresh token ?
06/17/2024 11:33 AM
access token
06/17/2024 06:56 PM
Please share logs in text file. once you run import job
06/17/2024 07:22 PM
06/17/2024 10:14 PM
Hi @IGAQ , try this once
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://xxxxxxx/security/v2.1/user/token",
"httpMethod": "POST",
"httpParams": "{\"idp\":\"xxxxxx\",\"username\":\"xxxxxx\",\"password\":\"xxxxxxxx\"}",
"httpHeaders": {
"Accept": "application/json"
},
"httpContentType": "application/json",
"authError": [
"InvalidAuthenticationToken"
],
"errorPath": "error.code",
"maxRefreshTryCount": 2,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abc",
"retryFailureStatusCode": [
401
]
}
}
}
06/18/2024 04:10 AM
Hello @NM i have tried above it did not work, getting same exception.
06/18/2024 04:54 AM
@IGAQ , can you check token call and see what all things are you passing in Body if it is working from postman?
06/18/2024 07:43 AM
Hi @NM we are passing 3 params like below in the body
{ "idp": "xxxxx",
"username": "xxxxxx",
"password": "xxxxx" }
Thanks,
06/18/2024 11:13 AM
Did you tried with hardcoded token ?
06/18/2024 08:26 PM
Yes It works and pulls accounts into Saviynt, with hardcoded access token.
06/18/2024 08:30 PM
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://xxxxxxx/security/v2.1/user/token",
"httpMethod": "POST",
"httpParams": "{\"idp\":\"xxxxxx\",\"username\":\"xxxxxx\",\"password\":\"xxxxxxxx\"}",
"httpHeaders": {
"contentType": "application/json"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abc"
}
}
}
06/19/2024 08:11 PM
Hi @rushikeshvartak tried above getting same exception.
The token was expected to have 3 parts, but got 1
06/19/2024 08:41 PM
Response coming in access_token ?
06/20/2024 08:06 PM
withthe above ConnectionJSON (with out testconnection block)Its not printing any thing on save/test connection, please find logs attached. when we add testConnection block on in the ConnectionJson we are getting this error -The token was expected to have 3 parts, but got 1
06/28/2024 11:58 AM
It worked by adding below in the ConnectionJSON:
"retryFailureStatusCode": [
400,401,403,500
],
06/28/2024 12:46 PM
You need to add all 4xx and 5xx series to get tokens regenerated in connection json