Keywords: Magento - Google Cloud Platform - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: 68828e02-ad26-4249-fd16-a93be10169cb
I am trying to access the Magento 2 REST-API from another website. My Magento host is configured with HTTPS (I followed the Bitnami's guides for this) and everything is working well.
Except when I'm trying to do a request on the REST-API (simple search request
/index.php/rest/all/V1/search), but it isn't working as I get a
OPTIONS 400 (Bad Request) error with the following error:
Access to fetch at 'https://magento.host/index.php/rest/all/V1/search' from origin 'https://external.website' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
I found the following post (https://community.bitnami.com/t/how-to-enable-cors-to-access-magento-rest-apis/65362) which is exactly the issue I have, and tried all suggested solutions but nothing works (editing apache confs doesn't fix it, unable to install the suggestion extension
Thanks, please let me know if you need more info.