I have enabled CORS on webApi
var corsAttr = new EnableCorsAttribute("http://localhost:14054", "*", "*") {SupportsCredentials = true};
config.EnableCors(corsAttr);
but when I my web project it from FF i still get the error
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:28821/Authenticate. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).1(unknown)
and this is what i get in chrome
XMLHttpRequest cannot load http://localhost:28821/Authenticate. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:14054' is therefore not allowed access.
when do the same thing in Edge or IE it works. I have done a bunch of reading but cant figure out how to stop the pre-flight to stop, but i think i read somewhere chrome & FF also include port numbers.
Either way I am aggravated and annoyed, can somebody tell me what I am doing wrong.
EDIT The other thing is this is public endpoint that I have published and been able to use the mobile app to consume the api just fine. this was before i started working on the web application.
EDIT
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS, PUT, DELETE, PATCH" />
<add name="Access-Control-Allow-Headers" value="authorization,accept,content-type,origin,cache-control,x-requested-with" />
<add name="Access-Control-Expose-Headers" value="x-sf3-api-version" />
</customHeaders>
</httpProtocol>
Thats the web config, and the above the enablecors() in the startup.register()
its not the OAuth or authentication logic cause it works from postman and works from mobile