Integrated Portal -testing API

jincyv
New Member

Hi,

I am facing similar issue with Integrated Portal.

I am trying to hit the authorise button and test my api. I am getting unauthorised as response.

Even after adding CORS security policy. I am getting CORS error.

When I hit the try API from Dev Portal, I got error

"Access to XMLHttpRequest at 'www.abc.com' from origin 'www.abc.apigiee.io' has been blocked by

CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."

On doing a trace on the Edge, the requests are actually hitting my edge I can see the incoming traffic now and options are getting passed instead of POST call> 401 unauthorised is the response I am getting there.

I am using Integrated Dev portal (Drupal is not used) for building my portal.

I kindly request to provide me a solution as I am struggling with multiple issues like CORS issue and the no response issue.

Solved Solved
0 2 223
1 ACCEPTED SOLUTION

@Jincy Jithin

Browser is doing a Preflight request to your api proxy. Since you only have access to the Apigee proxies, I would suggest to follow the below document -

https://docs.apigee.com/api-platform/develop/adding-cors-support-api-proxy

Go to the preflight section in the document. You need to add OPTIONS call in your api proxy which will return CORS headers and then the browser will do another call with POST verb.

View solution in original post

2 REPLIES 2

@Jincy Jithin

Browser is doing a Preflight request to your api proxy. Since you only have access to the Apigee proxies, I would suggest to follow the below document -

https://docs.apigee.com/api-platform/develop/adding-cors-support-api-proxy

Go to the preflight section in the document. You need to add OPTIONS call in your api proxy which will return CORS headers and then the browser will do another call with POST verb.

Thank you so much. This solution worked for me. I was passing content type in headers twice, from shared flow and as request parameters. That was another issue and when I removed content type from my parameter, everything started working. I really appreciate your help.