Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Authentication Issue/Token refresh issue for API with BasicWithAccessToken Auth type

Raksha_NS
New Contributor II
New Contributor II

Hi Team,

We are trying to connect to REST API with BasicWithAccessToken auth type. We see that when the connection JSON has a valid token, the connection works fine and all the operations are performed, but when the token expires in 48 hours, the connection fails and the response we receive from the target when it calls the API to get the token is null. 

We have also tried changing the auth type to Oauth and also tried adding authorization in the headers with encoded username and password.

Below is the connection JSON we currently. I have also attached the postman request and response. This call works perfectly fine in postman.

{
"authentications": {
"acctAuth": {
"authType": "BasicWithAccessToken",
"url": "http://hostname:port/v1/Account/Login",
"httpMethod": "POST",
"httpHeaders": {"Content-Type": "application/json"},
"properties": {"userName": "*******","password":"*******","Server": "***"},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"retryFailureStatusCode": [403,401,500,417,400],
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "token",
"tokenType": "",
"accessToken": "<valid token>"
}
}
}

Please let me if you have any other suggestions on this.

2 REPLIES 2

Rishi
Saviynt Employee
Saviynt Employee

Raksha_NS
New Contributor II
New Contributor II

This issue was resolved by using the below connection JSON. 

{
"authentications": {
"acctAuth": {
"authType": "BasicWithAccessToken",
"url": "<URL>",
"httpMethod": "POST",
"httpHeaders": {
"Accept": "application/json"
},
"httpParams": {
"UserId": "*****",
"Password": "*****",
"Server": "*****"
},
"properties": {
"userName": "******",
"password": "******"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"retryFailureStatusCode": [
403,
401,
417,
400,
500
],
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "token",
"tokenType": "",
"accessToken": "Bearer xyz"
}
}
}