Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/15/2022 07:47 AM
Hello,
I have an issue with my custom REST API which will be used to import users.
The connection json works but doesn't seem to be passing the access_token from the response to the saviynt ${access_token} token variable to be used in the importjson. JSON files below.
ConnectionJSON(Client specific data scrubbed):
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url":"",
"httpMethod": "POST",
"httpParams": {
"client_id": "",
"client_secret": "",
"username": "",
"company": "",
"password": "",
"grant_type": "password"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"errorPath": "errorCode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "AuthenticationResult.AccessToken",
"retryFailureStatusCode": [
401
]
}
}
}
UserimportJSON:
{
"connection": "userAuth",
"url": "<API URL>",
"httpMethod": "GET",
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded",
"Authorization": "${access_token}"},
"colsToPropsMap": {
"username": "<>~#~char",
"statuskey": "statuskey~#~char",
"preferedfirstname": "PreferredName~#~char",
"employeeid": "Empno~#~char",
"employeetype": "JobStatus~#~char",
"departmentname": "LocationName~#~char",
"displayname": "displayname~#~char",
"customproperty2": "FirstLanguage~#~char",
"leavestatus": "leavestatus~#~char",
"middlename": "Initial~#~char",
"location": "HomeOffice~#~char",
"firstname": "GivenName~#~char",
"lastname": "Surname~#~char",
"customproperty4": "PreviousSurname~#~char",
"title": "PositionName~#~char",
"customproperty15": "customtitle~#~char",
"startdate": "LastHireDate~#~char",
"customproperty5": "InitialHireDate~#~char",
"termDate": "TerminationDate~#~char",
"customproperty56": "Supervisorempno~#~char"},
"errorCode":"400",
"errorCodePath":"errorCode",
"userResponsePath": "results",
"userResponsePath": "value",
"pagination": {
"offset": {
"offsetParam": "Offset",
"batchParam": "Max",
"batchSize": 1000,
"totalCountPath": "total_count"
},
"nextUrl": { "nextUrlPath": "object.userProfile.Link"}
}
Solved! Go to Solution.
08/15/2022 08:02 AM
Can you share screenshot of working connection post from postman
08/15/2022 10:52 AM
Here is the connection post from postman
Here’s the token:
and here is the Get that would be used in the importuserjson
08/15/2022 12:52 PM
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "",
"httpMethod": "POST",
"httpParams": {
"client_id": "",
"client_secret": "",
"username": "",
"company": "",
"password": "",
"grant_type": "password"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"errorPath": "errorCode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer idk",
"retryFailureStatusCode": [
401
]
}
}
}
08/15/2022 12:56 PM
Thanks Rushikesh. How does Saviynt handle the access token not being known? As I see that you've put accessToken: "Bearer idk" . Basically looking for saviynt to input the access token from the tokenresponsepath every time to the accessToken variable.
Thanks,
Aundre
08/15/2022 12:59 PM
Specify the access token if its already available, else specify a dummy value or leave it blank. This value may change after the token refresh. |
https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide#RESTConnec... |