API gateway cors

hello. i’m in trouble with API gateway, i created the file appsettings.production.json which include {cors: enabled true, … } but despite this i still have cors problem when requesting from browser !

There is description of doing CORS here: - https://doc.developer.milestonesys.com/mipvmsapi/content/cors/

Is this what you do?

Please try with wild cards first, then if that works try the explicit.

Your browser might have a developer tool where you can find additional information about errors etc. What do you observe?

this is exactly what i am doing.. the browser just log “Access to fetch at ‘http://192.168.11.103/IDP/connect/token’ from origin ‘null’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.”

from postman it’s working

Instead of

http://192.168.11.103/IDP/connect/token

try

http://192.168.11.103/API/IDP/connect/token

Letting the authentication go through the API Gateway where you have setup CORS..

Note, when testing in my test server I had an error “Bad gateway” when using a Windows/AD user, but it worked when using a basic authentication user. I will investigate this further but I hope you are using, or you can use, a basic user.