In Part I of this Article, we have seen creation of an application with Forms Authentication i.e. when an application starts it should ask the user to enter login credentials.

In this let us discuss about how to create Windows Authentication Application.

Preparing Solution:

We have already created the project FormsAuthenticatioInLS; use that project to continue the creation of Users, Roles and Permission.

Let's confirm the Table has the following columns.

Setting Windows Authentication:

If the Table is perfect then next check with the Project Properties to confirm that you have selected Use Windows Authentication option.

Windows Authentication is recommended if all your users are on a windows domain and you want to trust that whoever is logged into their computer is the same user that is using the application.

It means you don't have to provide an additional login form. This is handy because you never have to store or manage passwords outside of Windows itself which makes it very secure, however this is usually only practical if the application is running in a corporate/domain Intranet environment.

In Project Properties Windows select Access Control and then select the option Use Windows Authentication.

You have two options with Windows Authentication.

- Allow only users specified in the Users screen of your application.
- Allow any authenticated Windows user.

The first option will let you to create users in our application to authenticate.

The User name must be a valid username in the form of an alias (jagan), domainand alias (jagansvr\jagan), alias and domain ([email protected]), orfully qualified domain name and alias (sbalram.corp.jagansvr.com\jagan), and it must be less than 256 characters. If you are using Forms authentication, the username must be unique and must be less than 256 characters.

The second option will allow all users in a Windows domain or authenticated by Windows. Press F5 to see the Application in Action.

As we have selected Windows Authentication our application is logged in automatically as a Windows Authenticated user.