Last post Jan 13, 2014 03:39 AM by Michelle Ge - MSFT
Jan 11, 2014 04:12 PM|stevex33|LINK
I'm looking in to windows authentication with WebAPI (Although I'm sure the same question may apply to MVC and possibly web forms).
I created a web project and selected WebAPI and mvc, and chanegd the authentication type to windows (All in the new project screen).
I looked in the webconfig expecting to see an authentication element within the system.web element, but no.
I then looked through the rest of the application and I couldn't find any reference to windows authentication.
So my question is, how does WebAPI know that I want to use Windows Authentication, and how do I change it to some other form of Authentication in the future if the need arises?
A separate but related question, what if I want to provide windows and custom authentication together? (I know it's probably not a good idea, but I can imagine someone asking me one day).
Jan 13, 2014 03:39 AM|Michelle Ge - MSFT|LINK
According to your description, you want to set windows authentication for the web API application. But the web.config did not display windows authentication flag.
In the Visual Studio 2012, as we create a webAPI application, we can click "Change Authentication" Button, then we can select Windows Authentication. The web.config file will contain code:
<authentication mode="Windows" />
For more information, please refer to the links below:
For more information about implementing custom authentication, please refer to the link below:
Hope it's useful for you.