I have an API Proxy configured on APIGEE which I am using in my React App with Axios.
The problem is when I enable the OAuth2.0 Policy in the proxy the API lands as OPTION and returns a CORS Error, while I send it as a POST.
The POST request lands successfully and also returns the intended response when I disable the OAuth Policy.
I also tried using the CORS policy in both the Proxy and Target Endpoint before and after the OAuth Policy but that to returns a CORS error.
I have read about the Options Preflight and how to handle it via APIGEE but that bypasses the Authorization as well and returns a null route which would render that request useless.
I'd really apricate some help on this. TIA
With preflight requests you are not expected to route this to a backend (no route). I am not sure which version of Apigee you are using but on X they now have a cors policy that you can generate preflight requests (). HOwever, if on other versions you can look at this approach cors policy