Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/18/2024 08:37 AM
Hi Team,
We are connecting to Topdesk application which is using a basic authentication generating a token every time we hit the URL. And we need to pass this token to other JSON like Import by concatenating "Token id=" in headers.
Example: Token id = "abs-asbsd".
Below are the JSON we have tested to perform the import accounts.
Connection JSON:
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "https://topdesk/tas/api/login/operator",
"httpMethod": "GET",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName": "",
"password": ""
},
"expiryError": "Couldn't authenticate you",
"authError": [
"Couldn't authenticate you",
401,
403,
500,
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"successResponses": {
"statusCode": [
200,
201,
202,
203,
204,
205
]
},
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "",
"tokenType": "TOKEN id=",
"accessToken": "TOKEN id=\"abcd\""
}
}
}
Import Account JSON:
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://topdesk/tas/api/persons",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "\"${access_token.substring(1,access_token.length()-1)}\"",
"Accept": "application/json"
}
},
"listField": "",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "networkLoginName~#~char"
}
}
}
}
}
With this configuration we are getting 401 unauthorized error as Token id is not getting concatenated in the import JSON call.
Kindly let us know how we can pass the access token by concatenating the Token id="".
Thanks & Regards,
Mohit.
07/18/2024 08:37 AM
"Authorization": "\"${access_token.substring(1,access_token.length()-1)}\"",
for authorization, in import json we also tried to pass it as ${access_token}.
07/18/2024 09:30 AM
Token id is not supported OOTB. raise idea ticket for enhancement.
07/18/2024 09:44 AM
Hi Rushikesh,
So passing Token Id concatenated with access token is not supported in Rest connector?
Example: Token id = "asds-basdbsa"
Can you please confirm once again.
Regards,
Mohit.
07/18/2024 09:44 AM
No