Last post Oct 29, 2013 02:53 AM by Steven Cheng - MSFT
Oct 28, 2013 03:12 AM|Valliii|LINK
I would like to create MVC application with various authorizations models.
One of them is forms authorization and second windows authorization by Active Directory login.
It's possible and how?
Oct 29, 2013 02:53 AM|Steven Cheng - MSFT|LINK
For ASP.NET web application (host in IIS), the authentication mode (whether windows or forms) quite rely on the authentication setting in IIS web application virtual diretory. Normally, windows authentication cannot be mixed with forms authentication in
IIS (for a given site, web application or virtual directory). When using forms authentication, we need to enable anonymous access in IIS, while for windows authentication we need to disable anonymous access (and enable integrated window authentication). Here
are two MSDN articles which provide detailed explanation on windows and forms authentication for ASP.NET web application in IIS:
And if you do need to authenticate user against both windows AD and custom database (normally for forms auth), you can consider the following approach:
Configure your ASP.NET web application to use forms authentication and add multiple membership providers in web.config. ASP.NET membership support normal SQL database based provider and also windows active directory based provider. And you can choose a specific
provider to use (when validate user's credentials submit from form) programmtically in code. For Windows Active directory based membership provider + forms authentiation, here are some MSDN articles for your information: