Reputation: 107
I have a WebApi project , which returns some data , this works fine when we query through the URL , but returns 401 when i invoke it from my console app. this project has been hosted in IIS 8 and i need this to run under windows authentication. If i set it to anonymous authentication then works fine, but gives error to windows auth mode. Thanks in advance.
Upvotes: 0
Views: 1164
Reputation: 960
Check this out(it has info on using windows authentication with web API):
https://www.codeproject.com/tips/996401/authenticate-webapis-with-basic-and-windows-authen
Upvotes: 1
Reputation: 77926
Check HTTP Status Codes RFC ...401
stands for Unauthorized Access
means while invoking from your console app you are not passing the Authorization
header in your API request.
Upvotes: 3