and more in a single search tool across platforms. Read the announcement here. |
07/15/2022 03:34 AM
We are trying to integrate box application with Saviynt and we had some limitation (because of custom role assignment) due to which we opted for Rest connector. All the use cases are working as expected except that the access token is expiring every 60 minutes, which means that the refresh token we have provided in the JSON is not getting picked up.
Have you come across similar issue with rest connector?
07/15/2022 03:56 AM - edited 07/15/2022 03:56 AM
Hi @anukl ,
That should be easy to resolve, you need to add a 'retryFailureStatusCode' parameter in your Connection JSON as below :
{
"authentications": {
"acctAuth": {
"authType": "BasicWithAccessToken",
"url": "{url}}",
"httpMethod": "POST",
"httpHeaders": {"Accept": "application/json"},
"properties": {"userName": "<username>","password": "<password>"},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"retryFailureStatusCode": [403,401,500],
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer xyz"
}
}
}
You can find a lot more examples and details on it on the REST Connector Guide :
https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide
07/15/2022 09:29 AM
Hi Sahaj,
Thanks for your response.
We have used "retryFailureStatusCode" parameter in connection JSON. But still the access token is expiring after 60 minutes.
07/17/2022 11:55 PM
@anukl ,
The access token would ideally expire as per your access token expiry time at the target. But the retrystatusfailurecode , if correctly mapped should invoke the connection json again to fetch a fresh token.
What is the current behaviour that you are seeing? Could you also provide your connection json here for reference.
07/18/2022 12:27 AM
Hi Sahaj,
We are using below Connection JSON format.
{
"authentications":{
"userAuth":{
"authType":"oauth2",
"url":"https://api.box.com/oauth2/token",
"httpMethod":"POST",
"httpParams":{
"client_id":"xxx",
"client_secret":"xxx",
"grant_type":"refresh_token",
"refresh_token":"${refresh_token}"
},
"httpHeaders":{
"Content-Type":"application/x-www-form-urlencoded"
},
"httpContentType":"application/x-www-form-urlencoded",
"expiryError":"ExpiredAuthenticationToken",
"authError":[
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"refreshType":"RefreshToken",
"refreshTokenResponsePath":"refresh_token",
"refreshToken":"abc",
"timeOutError":"Read timed out",
"errorPath":"errorCode",
"maxRefreshTryCount":5,
"tokenResponsePath":"access_token",
"tokenType":"Bearer",
"retryFailureStatusCode":[
401,
500,
400,
403,
502
],
"accessToken":"Bearer abc"
}
}
}
We are generating the access and refresh token from Postman. Newly generated token, we are adding it to connection JSON and the new token will work for approximately one hour. After that the it will get expire.
Please let me know if you need any other information.
Thanks & Regards,
Lakhitha
07/18/2022 12:35 AM
Hi @Lakhitha ,
You access token is expected to expire. From how you have setup your connection json, it looks like you are using refresh token to reissue a new access token?
07/18/2022 01:23 AM
Yes we are passing refresh token also in connection JSON.