1

I'm developing a web application with (MVC5 + AngularJS) for UI and WebAPI2 for webservices. Theose are two seperate projects hosted in different servers. And i'm Authenticating my webapp against an Active Directory. I enabled Windows Authentication for it and everything works perfect so far.

Now the problem is, I want to enable Windows Authentication on my WebAPI too. Only the authorized active directory users should be able to consume the web services. I enabled Windows Authentication features in IIS.

If i do so, the login prompt is fired twice. One for my MVC5, and second one fired when a webapi call is sent from angularjs. So literally i'm entering credentials twice. So my question is, Can we inherit/pass the credentials of first login to the WebAPI ajax call, so that we can supress the second prompt.

Thanks in advance...!!

Praveen
  • 167
  • 4
  • 13
  • did you get any solution for this? – Sushant Rawat Mar 05 '20 at 05:25
  • did you try sending the request from your angular along with "withCredentials: true" in your header? and the api should have both the Anonymous authentication and Windows authentication enabled. Refer to other SO questions on the same. – Ak777 Jul 14 '20 at 18:58
  • https://stackoverflow.com/questions/5402381/receiving-login-prompt-using-integrated-windows-authentication – Ak777 Jul 14 '20 at 18:58

0 Answers0