关于.net:如何进行React App Windows身份验证

How to make a React App windows Authentication

已通过Windows身份验证在.Net中创建了Web API。当在React APP中调用API时,获得401 Unauthorized。 Web API在具有Windows身份验证的浏览器中可以正常工作。

1
2
3
4
5
6
7
axios.get('http://.../.../user/Data')
    .then(function (response) {
      console.log(response);
    })
    .catch(function (error) {
      console.log(error);
    });```


使用fetch设置credentials: include选项。另外,我认为Access-Control-Allow-Credentials标头需要在后端设置。

我是前端开发人员,所以我不确定为Windows身份验证配置后端的全部内容。