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

Box using Rest Connector: Access Token expiration

anukl
New Contributor
New Contributor

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?

6 REPLIES 6

sahajranajee
Saviynt Employee
Saviynt Employee

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

 


Regards,
Sahaj Ranajee
Sr. Product Specialist

anukl
New Contributor
New Contributor

Hi Sahaj,

Thanks for your response.

We have used "retryFailureStatusCode" parameter in connection JSON. But still the access token is expiring after 60 minutes.

sahajranajee
Saviynt Employee
Saviynt Employee

@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.


Regards,
Sahaj Ranajee
Sr. Product Specialist

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

sahajranajee
Saviynt Employee
Saviynt Employee

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? 


Regards,
Sahaj Ranajee
Sr. Product Specialist

Yes we are passing refresh token also in connection JSON.