Im trying to consume asp.net web api(Rest) through my webapp. It throws unauthorized error. Only windows authentication is enabled in Webapi.
Note :- Both api and web app is built on .net48.
WebAPI Authentication Settings in server
When I invoke APi I have set the UseDefaultCredentials to true in HttpclientHandler.
UseDefaultCredentials set to true in HttpclientHandler
This works in my local machine. But in server it throws error.
Can anyone please help me here?
If I enable anonymous authentication in Webapi it works.
But, It should only work on windows authentication. I have set authentication mode to windows in web.config.