Hi,
I am using self managed version of tyk.
I am using tyk to bypass the url. In tyk I have created the api using Open Id authorization.
The api is working perfectly when I call it from postman.
But it is showing as ‘Access to XMLHttpRequest at ‘http://:8080/api/1’ from origin ‘http://localhost:4200’ 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.’
I tried to resolve by only selecting ‘Options pass through’ in advanced options- but the issue was not solved.
Also I tried by enabling CORS, Allowed Origin as * , selected all methods in the dropdown as Allowed methods,* as Allowed headers - still the issue not resolved.
My back end application supports all headers and origin.
Is there any issue while connecting local host to tyk apis?
Based on the header response, the ‘Access-Control-Allow-Origin’ header is present on the gateway.
I would assume the call was made directly to the gateway (through something like CURL) and not through Angular via the browser. So it may be worth seeing the header requests and responses from Angular’s point of view.
Also, can you create a Http Bin API definition and run a simple test to /get path in the gateway through Angular. I am interested in knowing the result.