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

Rest Connector : Token is not re-generated after it expires

nbillu
New Contributor II
New Contributor II

Hi Team,

I am using REST connector for an application integration. If I pass the token which I get in postman response, it's working till 5min and then it's failing after the token expires. However, I need to pass the token for every 5 mins

Here is my connection Json and postman response.

Please do let me know what I am missing.

Connection Json :
{
"authentications": {
"authenticationTokenFromConnectionJSON": {
"authType": "oauth2",
"url": "https://*******",
"httpMethod": "POST",
"httpParams": {
"username": "*********",
"password": "*******",
"grant_type": "password",
"client_id": "*******",
"type": "request-body",
"client_secret": "*********"
},
"httpHeaders": {},
"httpContentType": "application/x-www-form-urlencoded",
"authError": [
"HTTP 401 Unauthorized"
],
"errorPath": "error",
"retryFailureStatusCode": [
401
],
"maxRefreshTryCount": 5,
"refreshType": "RefreshToken",
"tokenResponsePath": "access_token",
"refreshTokenResponsePath": "refreshToken",
"tokenType": "Bearer",
"accessToken": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIycVd0bEFPdURGa1Juc0ZnYi10dHFhR2tUX1VvYzNZODdmM1R0d01NRGN3In0.eyJleHAiOjE3MTEzNDI2NT",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5MDkxZWZlOS0yNjcxLTRiNmEtYjU2Ni05MzJwiaXNzIjoiaHR0cHM6Ly90ZXN0LW5vdi1henVyZS5lYy5zaGVsbC5jb20vYXV0aC9yZWFsbXMvZW5lcmd5eCIsImF1ZCI6Imh0dHBzOi8vdGVzdC1ub3YtYXp1cmUuZWMuc2hlbGwuY29tL2F1q4",
"testConnectionParams": {
"http": {
"url": "https://********",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"successReponse": [
200
],
"successResponsePath": "",
"errors": [
"500 Internal Server Error",
"404"
],
"errorPath": "error"
}
}
}
}

Postman Response :

nbillu_0-1711348564818.png

and here is the logs:

 
nbillu_0-1711349180431.png


Regards,

Navya Billu

[This message has been edited by moderator to mask URL]
2 REPLIES 2

CR
Regular Contributor III
Regular Contributor III

check below resp will help

 

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "http://XXX",
"contentType":"application/x-www-form-urlencoded",
"httpParams": {
"grant_type": "refresh_token",
"refresh_token": "${refresh_token}"
},
"httpHeaders": {
"Authentication":"Basic ODI1NjgzNjpURVNUSU5H",
"Accept":"*/*"
},
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"httpMethod": "POST",
"httpContentType": "application/x-www-form-urlencoded",
"refreshType": "RefreshToken",
"refreshTokenResponsePath": "refreshToken",
"refreshToken": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI4MjU2ODM2IiwiaXNzIjoiS05PV2JpbGl0eSIsImlhdCI6MTY4OTAyMDk2OCwiZXhwIjoxNjg5MDY0MTY4LCJ0eXAiOiJyZWZyZXNoIn0.oAreMAZkST1XB7TpBliTxnCpCwC03sw3mwKtzQC_2wGwJeQNfBN6ijP_PPfRnWBCfVGLujBsT08moQsIyiPt5g",
"timeOutError": "Read timed out",
"errorPath": "error",
"maxRefreshTryCount": 1,
"authHeaderName": "Authentication",
"tokenResponsePath": "accessToken",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401,403,500
],
"accessToken": "Bearer abc"
}
}
}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

nbillu
New Contributor II
New Contributor II

Hi Raghu,

I tried with this json. If I  pass the token it's working. Once the token expires getting below error. same as before no change 

shell.png

Regards,
Navya Billu

[This post has been edited by a Moderator to remove sensitive information.]