and more in a single search tool across platforms. Read the announcement here. |
03/28/2024 02:43 AM
Hi All,
We have an application which is integrated using REST API. We observed that the reconciliation job for the application started failing with the below error one day all of sudden.
DEBUG rest.RestProvisioningService - Access token expired. throwing null / [InvalidAuthenticationToken, AuthenticationFailed, FAILURE, 401, 403, 500, 500 Internal Server Error] exception for retry
2024-01-02 11:30:05,663 [quartzScheduler_Worker-24] ERROR rest.RestProvisioningService - Exception in pullObjectsByRest :Ambiguous method overloading for method java.lang.Exception#<init>.
However, it was working for months before it started failing and we had made no changes in the configurations.
Then after a month it started working on its own, and starting March its failing again, without any changes to the configs with the same error as above.
Please let me know if someone has ever come across something familiar and how to fix this.
Regards,
Akanksha Handa
03/28/2024 03:07 AM
Looks like authentic error , Token expired or check in postman once
03/28/2024 05:36 AM
It seems application is using refresh token instead of access token which expires after some months
03/29/2024 03:10 AM
Hello,
Could you please tell if there is a way to make sure of this from Saviynt logs, to be able to convey to the application team?
Also, what would be the recommended solution to fix the issue?
Regards,
Akanksha handa
03/29/2024 10:10 AM
Enable showlogs :true in config json in connection
03/29/2024 11:45 AM
Disclaimer - This is an AI generated response and feedback will be used to fine-tune
Based on the description of the error you're encountering, it seems the issue primarily revolves around the expiration and renewal of access tokens used for authentication with your application's REST API. Given the intermittent nature of the issue, a likely cause is the token refresh mechanism not functioning as expected, or the application not handling expired tokens correctly, causing failed attempts at data reconciliation.
To address these issues, it's important to implement a robust mechanism for managing authentication tokens, including their renewal before expiration and handling errors related to token expiration effectively. Below is an example JSON configuration for a REST connection that includes fields for error handling and token management, adapted from the REST Connector Guide. This configuration outlines how to specify error handling for expired tokens and the retry mechanism, ensuring the connector attempts to refresh the token or reauthenticate as needed.
{
"ConnectionName": "YourApplicationConnection",
"ConnectionDescription": "Connection for Application XYZ",
"ConnectionType": "REST",
"authtype": "OAuth",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Access token expired"
],
"errorPath": "error_description",
"retryFailureStatusCode": [401, 403],
"maxRefreshTryCount": 3,
"ConnectionJSON": {
"authentications": {
"authType": "OAuth",
"tokenURL": "https://yourapplication.com/oauth/token",
"clientId": "YourClientId",
"clientSecret": "YourClientSecret",
"scope": "requiredScope",
"grantType": "refresh_token",
"refreshToken": "YourRefreshToken",
"accessTokenPath": "access_token",
"expiryPath": "expires_in",
"tokenType": "Bearer",
"httpMethod": "POST"
}
}
}
Ensure your application's backend or the REST API itself robustly handles token expiration scenarios, such as attempting to refresh the token before it expires and providing clear error responses when the token is invalid or expired. Properly implementing such mechanisms can prevent issues like the one you've described and ensure more reliable connectivity and data processing.