Click HERE to see how Saviynt Intelligence is transforming the industry. |
12/08/2023 01:50 AM
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.
Solved! Go to Solution.
12/08/2023 09:16 AM
Can you try to increase the timeout value in the connection?
https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Configuring-Provisioning-Tasks-and-Conne...
12/18/2023 01:50 AM
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"
}
}
}