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

access token is not getting populated in user import json -REST

Srinath1
New Contributor II
New Contributor II

Hi

we are using a rest connection; The access token expires every 20 minutes. 

we are able to get the data into saviynt by hardcoding the access token value in user import json

the access token is not getting passed to the userimport json  and access token is not refreshing automatically.

please find the connection json  and postman collection

 

Connection JSON

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "url/v1/access_token",
"httpMethod": "POST",
"httpParams": {
"grant_type": "client_credentials",
"client_secret": "xxxxxxxxxxxxxxxxAH",
"client_id": "4xxxxxxxxxxxxxxxxx5xxxxxIr"
},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenType": "bearer",
"tokenResponsePath": "access_token",
"authHeaderName": "Authorization",
"accessToken": "Bearer xxxxxxxxxxxxxxxxxx",
"retryFailureStatusCode": [
401
]
}
}
}

User import json

{
"connection": "acctAuth",
"url": "url",
"httpMethod": "GET",
"httpHeaders": {
"access_token": "${access_token}",
"Authorization": "Basic xxxxxxxxxxxxxxxxxxxxxx ",
"APIKey": "xxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
"Accept": "application/json"
},
"userResponsePath": "Output",
"colsToPropsMap": {
"customproperty17": "BusinessUnit~#~char",
"customproperty18": "BusinessUnitID~#~char",
"city": "City~#~char"
},
"statusConfig": {
"active": "false",
"inactive": "true"
}
}

postman screenshots

For getting accesstoken

Srinath1_0-1690563566399.png

for getting users

Srinath1_1-1690563692826.png

 

 

 

 

7 REPLIES 7

pmahalle
All-Star
All-Star

Hi @Srinath1 ,

Can you below user import json 

{
"connection": "acctAuth",
"url": "url",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"APIKey": "xxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
"Accept": "application/json"
},
"userResponsePath": "Output",
"colsToPropsMap": {
"customproperty17": "BusinessUnit~#~char",
"customproperty18": "BusinessUnitID~#~char",
"city": "City~#~char"
},
"statusConfig": {
"active": "false",
"inactive": "true"
}
}


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

Srinath1
New Contributor II
New Contributor II

Hi 

if u can see in the postman screenshots above , the authorization value is static

Srinath1_0-1690565500869.png

 

we are using access token + basic auth to get the users , we are able to get the users into saviynt  by hardcoding the access token value in access_token  in user import Json 

our problem is the access token is not getting refresh in the connection json and not able to pass the access token to the userimport json 

rushikeshvartak
All-Star
All-Star

How much time it take to get full user response using user import.


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

Hi Rushikesh

Srinath1_0-1690784747515.png

around 30mins

Srinath1
New Contributor II
New Contributor II

Hi @rushikeshvartak  any update for my query

Srinath1_0-1690787271201.png

error displayed on job control panel

 

Vedanth_BK
Saviynt Employee
Saviynt Employee

Hi @Srinath1 

I have constructed the JSONs based on the above screenshot. Please check with the below jsons.
Also, confirm the prefix for access_token in the GET call
i.e do we have to provide BearerToken before the generated token?

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"URL": "<<enter the valid URL>>",
"httpMethod": "POST",
"httpParams": {
"grant_type": "client_credentials",
"client_id": "<<enter the valid CLIENT_ID>>",
"client_secret ": "<<enter the valid CLIENT_SECRET>>"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "Access token is expired.",
"authError": [
"ExpiredAuthenticationToken",
"Access token is expired."
],
"timeOutError": "Read timed out",
"errorPath": "message",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "BearerToken",
"authHeaderName": "access_token",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer ABCD"
}
}
}

{
"connection": "acctAuth",
"url": "<<enter the valid URL>>",
"httpMethod": "GET",
"httpHeaders": {
"access_token": "${access_token}",
"Authorization": "<<enter the valid Basic token>>",
"APIKey": "<<enter the valid API Key>>",
"Content-Type": "application/json",
"Accept": "application/json"
},
"userResponsePath": "Output",
"colsToPropsMap": {
"username": "BusinessUnitID~#~char",
"customproperty17": "BusinessUnit~#~char",
"customproperty18": "BusinessUnitID~#~char",
"city": "City~#~char"
}
}

For the error that you see i.e invalid url 

Please try URL encoding the special characters in the JSON URL.
example: 
+ needs to be replaced with %2B
space with %20

Attaching an online URL encoding reference Link.

Thank you 

Vedanth B.K