3

I am developing web application using angularJS and web api. I have hosted two separate projects on IIS. The URL for AngularJS is 'http://10.36.217.16:8081/index.html' and for web api is 'http://10.36.217.16/api/test'. I have enabled the windows authentication for both the sites and disabled the anonymous authentication on IIS. I have also passing 'withCredentials: true' on ajax request. I have set the authorization filter on my controller. I have also enabled the CORS in api and set SupportsCredentials is true.

My problem is the login prompt is fired twice, one for angular app and second for web api. How to pass the credentials after the first login prompt? Is there any setting which I have missed out.

I tried almost everything, please help! :)

1
  • Instead of an IP address try using the hostname without any dots: http://myhostname:8081/index.html which should send the AJAX request to http://myhostname/api/outage. Commented Apr 3, 2017 at 6:44

1 Answer 1

0

No need to use Windows Authentication for both of two sites(Angular and web APIs). Set anonymous authentication enable in Angular app and enable Windows authentication in Web API site only. It will help to work fine your system with single login prompt.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.