Failed to parse simple web token. http request

Hello all,
Im making http request according to UiPATH communicates with Azure Service Bus | by ranjani ranju | RPA Freaks | Medium
i always get Failed to parse simple web token 401
any idea why this happening?

@Hazem_Saleh

First check the API with Postman…then try using the same here in UiPath by getting curl and importing that way you can get better info about errors and fix them before trying on UiPath directly

cheers

Thanks i found the issue with a temp solution.
Its the encoding of the URL, post man have prescript.

function createSharedAccessToken(uri, saName, saKey) {
if (!uri || !saName || !saKey) {
throw “Missing required parameter”;
}
var encoded = encodeURIComponent(uri);
var now = new Date();
var week = 606024*7;
var ttl = Math.round(now.getTime() / 1000) + week;
var signature = encoded + ‘\n’ + ttl;
const hash = CryptoJS.HmacSHA256(signature, saKey).toString(CryptoJS.enc.Base64)
return ‘SharedAccessSignature sr=’ + encoded + ‘&sig=’ +
encodeURIComponent(hash) + ‘&se=’ + ttl + ‘&skn=’ + saName;
}

i have the link generated from above to Http request in UiPath but not sure how to make this in UiPath

BR/Hazem

@Hazem_Saleh

you cant directly acheive it…this is a workaround for the same

cheers

Im trying in inject JS script but no luck do you have any example ?