Hi,
I have .net core(.NET 6) api and React application at client side.
when ever i am enabling the windows authentication in web api and hosted on IIS always getting 401 unauthorized and CORS error .
launchsetting.json
"iisSettings": {
<big>"windowsAuthentication": true,
"anonymousAuthentication": false,</big>
"iis": {
"applicationUrl": "http://localhost:9100",
"sslPort": 9001
},
"iisExpress": {
"applicationUrl": "http://localhost:54241",
"sslPort": 44381
}
},
in startup.cs
<big>builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme).AddNegotiate();</big>
and in iis
click on authentication menu and configure
<pre>Anonymous Authentication Enable
Windows Authentication Enable
What I have tried:
I tried to configure as following link
Configure Windows Authentication in ASP.NET Core | Microsoft Docs[
^]
but not able to resolve the issue. may be due not able to configure web.config file asper article.
but when i am enabling the
Anonymous Authentication Enable
Windows Authentication Enable
both Anonymous and windows the it is working fine .
but not sure about pros and cons .