Reputation: 153
Web API has been created in .Net with Windows Authentication. When am invoking the API in React APP getting 401 Unauthorized. Web API Works fine in the browser with windows authentication.
axios.get('http://.../.../user/Data')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});```
Upvotes: 8
Views: 11609
Reputation: 393
With fetch
I set the credentials: include
option. Also, I think the Access-Control-Allow-Credentials
header needed to be set on the back-end.
I'm a front-end developer so I'm not sure what all went into configuring the back-end for Windows Authentication.
Upvotes: 4