We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

CORS Missing Allow Origin when fetching /connect/token

When I am using Curl with my new application, I can successfully obtain a token and convert a word doc. However, when doing so from any server, using the same parameters, I am running into “CORS Missing Allow Origin” when trying to get the token. I have added the domains to the application’s CORS Origin URLs, e.g. https://mydomainnameishidden12345.com and http://localhost:3000 so it should work.

Referrer Policy: strict-origin-when-cross-origin

And here are the request headers for the token request-- any help would be appreciated. Thanks!

OPTIONS /connect/token HTTP/2
Host: api.aspose.cloud
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Referer: http://localhost:3000/
Origin: http://localhost:3000
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
TE: trailers


I have tested the scenario using following cURL command without any issue. Hopefully, it will help you to accomplish the task.

curl -H "Origin: http://localhost:3000/" -X POST "https://api.aspose.cloud/connect/token" -d "grant_type=client_credentials&client_id=xxxx-xxxx-xxxx-xxxx-xxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxx" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"

As I said, I already had it working with curl. Using curl does not cause the issue because curl does not have security related to CORS-- but calling the API from any web browser will cause the issue.

I know we can get around this by using a proxy, but I was hoping since the Aspose Dashboard asks for CORS Origin Urls, the server would include the necessary CORS headers to work with standard fetch in Node.js. Thanks, anyways-

Browser error-- aspose server response is missing required headers:

cors_missing_headers_from_aspose_server_040423.png (9.3 KB)

Aspose dashboard CORS Origin Urls:

cors_missing_headers_from_aspose_server_040423_Dashboard_settings.png (72.7 KB)

Per Mozilla-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin

The response to the CORS request is missing the required Access-Control-Allow-Origin header, which is used to determine whether or not the resource can be accessed by content operating within the current origin. I would appreciate your help! Thanks!


Thanks for the additional information. We have logged a ticket(PLATFORM-1320) for further investigation and rectification. We will keep you updated about the issue resolution progress within this forum thread.