ng2-file-upload
ng2-file-upload copied to clipboard
Failed to load resource: the server responded with a status of 401 (Unauthorized)
hi, i am trying to implement the server API (dotnet core 2.2)with Active Directory authentication. And on my client side, i am using Angular 8 with ng2-file-upload. I keep getting an 401 401 Unauthorized with request method: OPTIONS. I already setup the CORS on the server but still not work. Please help
Request URL: http://localhost:5000/api/client/ImportClientDemographic Request Method: OPTIONS Status Code: 401 Unauthorized Remote Address: [::1]:5000 Referrer Policy: no-referrer-when-downgrade Cache-Control: private Content-Length: 6108 Content-Type: text/html; charset=utf-8 Date: Thu, 12 Sep 2019 20:48:49 GMT Server: Microsoft-IIS/10.0 WWW-Authenticate: Negotiate, NTLM X-Powered-By: ASP.NET X-SourceFiles: =?UTF-8?B?QzpcWWFvbWluZ1xFSVNcTm9uUmVzXEVJU05vblJlcy5BcGlcYXBpXGNsaWVudFxJbXBvcnRDbGllbnREZW1vZ3JhcGhpYw==?= Provisional headers are shown Access-Control-Request-Method: POST Origin: http://localhost:4200 Referer: http://localhost:4200/ Sec-Fetch-Mode: no-cors User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
below is the error message shown on console
zone-evergreen.js:2952 OPTIONS http://localhost:5000/api/client/ImportClientDemographic 401 (Unauthorized)
scheduleTask @ zone-evergreen.js:2952
scheduleTask @ zone-evergreen.js:378
onScheduleTask @ zone-evergreen.js:272
scheduleTask @ zone-evergreen.js:372
scheduleTask @ zone-evergreen.js:211
scheduleMacroTask @ zone-evergreen.js:234
scheduleMacroTaskWithCurrentZone @ zone-evergreen.js:1107
(anonymous) @ zone-evergreen.js:2985
proto.
Hi,
It really looks like a CORS issue. Please, check if you are correctly setting the Access-Control-Allow-Origin
header.
If it is, please give us details about the OPTIONS call response (headers and body).
localhost:5000/api/gList/?zone.js:2863 =user::3 401 (Unauthorized)