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 regenerated upon expiration

rakesh_iam
New Contributor
New Contributor

Dear All,

We are leveraging Sav4Sav REST Connector to execute a runtime analytics. The job runs for more than couple of hours. We are seeing the following behaviour,

  •  
  • We set up the connection json and when we ran the job for the first time - the job runs for an hour and fails with error code (401 - Unauthorized error). We have configured the retryFailureStatusCode but still we are seeing the error.
  •  When we try running the job subsequently, the job fails with error code '401'. The job could start the execution only when we copy the accessToken from postman every time.

Could you please assist with this? We have provided below - the connectionJson that we are using. 

Thanks,

Rakesh

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json"
},
"authError": [
"InvalidAuthenticationToken"
],
"url": "https://<domainname>.saviyntcloud.com.saviyntcloud.com/ECM/api/login",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"username\":\"<username>\",\"password\":\"<password>"}",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer <token copied from postman>",
"retryFailureStatusCode": [
401
]
}
}
}
4 REPLIES 4

SB
Saviynt Employee
Saviynt Employee

Can you try with the below Connection JSON. 

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://abc.saviyntcloud.com/ECM/api/login",
"httpMethod": "POST",
"httpParams": "{\"username\":\"user\",\"password\":\"pass\"}",
"httpHeaders": {
"contentType": "application/json"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"FAILURE",
"INVALID_SESSION_ID"
],
"timeOutError": "Read timed out",
"errorPath": "code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abcde",
"retryFailureStatusCode": [
401,
404,
403,
500
]
}
}
}

Regards,
Sahil

stalluri
Regular Contributor II
Regular Contributor II

You can try this out.
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json"
},
"authError": [
"InvalidAuthenticationToken"
],
"url": "https://SaviyntURL/ECM/api/login",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error.code",
"maxRefreshTryCount": 2,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer ABCD",
"httpParams": "{\"username\":\"admin\",\"password\":\"Not4$password\"}",
"retryFailureStatusCode": [
401
]
}
}
}

Please let us know if you need anything else.


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

DixshantValecha
Saviynt Employee
Saviynt Employee

Can you try with the below Connection JSON. 

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json"
},
"authError": [
"InvalidAuthenticationToken"
],
"url": "https://SaviyntURL/ECM/api/login",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error.code",
"maxRefreshTryCount": 2,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer ABCD",
"httpParams": {
"username": "your_username",
"password": "your_password"
},
"retryFailureStatusCode": [
401
]
}
}
}

It seems to be working. Thank you!