Unable to refresh token automatically - OAuth AWS Cognito

We are facing an issue related to the Freshdesk OAuth access token regeneration automatically. We are able to authorize the user via OAuth and access the application APIs working properly with access_token. However, the access token expires in a certain period and unfortunately, the app does not regenerate the access token automatically using the refresh_token.

Details:

{
    "errors": [
        {
            "message": "Invalid token",
            "locations": [
                {
                    "line": 1,
                    "column": 29
                }
            ],
            "path": [
                "getOrderData"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "exception": {
                    "response": "App Exception",
                    "status": 401,
                    "message": "Invalid token",
                    "name": "AppException",
                    "statusCode": 401,
                    "stacktrace": [
                        "AppException: Invalid token",
                        "REDACTED"
                    ]
                }
            }
        }
    ],
    "data": {
        "getOrderData": null
    }
}

Can you please help me resolve the issue?

Hi @Mohd_Asif_Mansoori,

When an API with OAuth enabled gets 401 error, our platform uses the refresh token to fetch a new access token if the refresh token is available.

In the third-party side, does it expect any additional headers to say that this app requires refresh token as well? In some third-party, this is the norm. Not sure about here.

If you can upload it as a custom app and test once, if it fails to refresh, can you share the moment when the API fails, we can check the logs at our end and confirm what’s happening.
We may also need some more information like your account domain and app ID.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.