Getting Authorization failed error in aspose node

I am getting “Authorization failed” error while sending request for conversion from word to html.

function invokeApiMethodInternal(requestOptions, confguration, notApplyAuthToRequest) {
    return __awaiter(this, void 0, void 0, function* () {
        requestDebug(request, (type, data, r) => {
            if (r.writeDebugToConsole) {
                const toLog = {};
                toLog[type] = data;
                // tslint:disable-next-line:no-console
                console.log(JSON.stringify(toLog, undefined, 2));
            }
        });
        if (!requestOptions.headers) {
            requestOptions.headers = {};
        }
        requestOptions.timeout = 1000 * confguration.timeout;
        requestOptions.headers["x-aspose-client"] = "nodejs sdk";
        requestOptions.headers["x-aspose-client-version"] = "22.10";
        requestOptions.uri = encodeURI(requestOptions.uri.toString());
        const auth = confguration.authentication;
        if (!notApplyAuthToRequest) {
            try {
                yield auth.applyToRequest(requestOptions, confguration);
            }
            catch (error) {
                throw new Error("Authorization failed");
            }
        }

@Ghaz786

It seems token refresh issue and you are using a quite old version of SDK. Please try the latest version of the Aspose.Words Cloud SDK for Node.js. It refreshes the token automatically.

Hi Tilal
the same code is working fine on our UAT server . which is the exact replica of our production server where the issue is coming . it was working fine earlier. can you suggest the solution for this

Regards
Ghazi

@Ghaz786

I am afraid it is quite difficult to comment on the error without reproducing it at our end. Please ensure you are using the latest version of Aspose.Words Cloud SDK for Node.js and using the same(valid) credentials on production as on your UAT server.