Mat*_*han 7 .net windows-authentication reactjs axios
Web API 已在 .Net 中使用 Windows 身份验证创建。当我在 React APP 中调用 API 时得到 401 Unauthorized。Web API 在具有 Windows 身份验证的浏览器中工作正常。
axios.get('http://.../.../user/Data')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});```
Run Code Online (Sandbox Code Playgroud)
fetch我设置了选项credentials: include。另外,我认为Access-Control-Allow-Credentials标题需要在后端设置。
我是一名前端开发人员,因此我不确定为 Windows 身份验证配置后端的全部内容。
| 归档时间: |
|
| 查看次数: |
6345 次 |
| 最近记录: |