I have any angular2
app accessing asp.net core webapi
service. It is working if webapi iis configuration is (Properties\launchSettings.json):
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:12246/",
"sslPort": 0
}
},
However, it throws the error once WindowsAuthentication
is true
and AnonymousAuthentication is false
. The error:
XMLHttpRequest cannot load http://localhost:12246/api//values/getSettings. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 401.
Any idea please?