Authentication failed error on file uploading using Aspose.Storage Cloud SDK for .NET C#

Hello,

When uploading a word document using the storage API it returns an “Authentication failed!” error message.

I’m using the SDK to send the request. I had to rebuild it myself as it was not strongly named (As per Strong Name for Aspose.Words Cloud references) however other then to add the string name key signing I have not made any changes to it.

I have attached the capture from the Fiddler monitoring tool to capture the output. AuthenticationError.zip (19.7 KB)

Can you please clarify why I am getting this error. I have already confirmed that the app key and SSID match the one shown in my cloud dashboard.

@mstride

Thanks for your inquiry. Please note Aspose.Words for Cloud does not allow special characters in signature URL at the moment. So please double check that your file names should not contain any special characters. Furthermore, if you are not passing some value of versionId and storage to storage API then pass null values for these parameters instead of empty strings. Hopefully it will resolve the issue.

We also receive {“Message”:“Authentication failed!”} on some of our API calls. This has nothing to do with our API keys, as >99% of the API calls are ok.

In other words, there is a bug in the authentication in some edge cases. The timestamps on when this error did happen for us:

  • 5/8/2019 05:59
  • 5/10/2019 01:38

@rvanlaak

Can you please share some more details about the API calls? Apparently, it seems some issue with the specific request URL.

These API calls are the same as always

  • upload file to storage
  • document statistics (pages, words)
  • document split as png per page and store as zip

@rvanlaak,

Thanks for sharing the additional information. Please note we have recently released V4 API version of Aspose.Words Cloud. We have implemented Aspose.Words Cloud as Microservice and it is more improved and optimized. We have also introduced API methods for storage operation. It includes File API to upload files, please use it for uploading files along with other operations. It will resolve the issue.

// First get JSON Web Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"


// cURL example to upload file to Aspose Cloud Storage
curl "https://api.aspose.cloud/v4.0/words/storage/file/sample.docx" 
-X PUT
-H "accept: application/json" 
-H "Content-Type: multipart/form-data" 
-T C:/sample.docx
-H "authorization: Bearer [ACCESS_TOKEN]"