2

Does anyone have a link to a good blog post describing how to configure and develop a web application (website) in AngularJS that is supposed to used a Web API developed in MVC5 (this is actually less important). The Web API and the web application is supposed to be deployed in Intranet, so they are supposed to use Windows Authentication. It appears that setting the authentication element to "Windows" is not enough.

<authentication mode="Windows"/>

There must be more steps to be taken, perhaps prior or at the time $http.get is called, when accessing the methods available in the Web API's interface.

I researched this topic for a few days now but could not find a good resource describing the whole process.

Thanks, Ed

1 Answer 1

1

These two entries under system.web

<authentication mode="Windows" />
<authorization>     
  <deny users="?" />      
</authorization>  

The above two will give you a starting point. In Razor you can render this string to your page to see the current logged in user. @User.Identity.Name

Seeing the user on a page gives you an idea if it is working.

Also if you change the deny users questionmark to an asterik you should start to get prompted for credentials. Put it back to a question mark.

The above on a real view page will let you know that it is working at its fundamental level.

Also remember to select your prj file in Solution Explorer and then press F4. Then select the windows authentication property of true. This is a project setting independent of your runtime config setting but it allows debugging.

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

1 Comment

Thank you for your comment. I created an empty Web application project and I selected Windows Authentication. I noticed that Visual Studio placed those lines in the <system.web> section of the configuration file. Now a really stupid question coming from someone that has just started learning about web development. How does a browser know what type of credentials to provide when accessing a web page. I am guessing that Fiddler can show the header of the GET requests and I can see the credentials provided by the browser. How does the browser know what to send?

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.