Jaggu
Jaggu

Reputation: 6428

Windows authentication and Forms authentication in same application

I have forms authentication already built in my web application. Can I have Windows authentication and forms authentication in the same application. So first authentication is tried using Windows authentication and if it fails then it is done using Forms authentication.

Upvotes: 1

Views: 1877

Answers (1)

VinayC
VinayC

Reputation: 49195

Its possible - exact mechanism would depends upon where your user store is located at - for example, let's say you have your own users table in the database that you are using for doing Forms authentication. In such case, you can offer windows authentication by mapping your user to the windows user(s) - it can be as simple as maintaining a column in the users table.

Basic idea is to to configure ASP.NET to use forms authentication - the login page uses windows authentication and if user is authenticated then do not display login-form. See this link for more info: http://mvolo.com/iis-70-twolevel-authentication-with-forms-authentication-and-windows-authentication/

On related note, see this SO question: Mixing Forms authentication with Windows authentication

Upvotes: 5

Related Questions