i

ASP.Net A Complete Guide

Windows Authentication

If you are creating an application only for a limited number of people who are part of a network domain, then Windows Authentication is the best choice. Users are authenticated against the identity store such as Active Directory, and the credentials are not transmitted across the Internet.

For enabling the windows authentication, we need to add below key in the web.config file.

Windows authentication helps when the user using the application that belongs to the same organization and also the applications method validate the user by using the credentials stored in the windows domain.

Authorization:

Authorization means providing the approval to access the requested resource. The resource may be like the web page, image, any file, etc. After the user is authenticated, then the Authorization comes in the picture.

If different users need to have different privileges, then impersonation in ASP.net configuration files needs to be turned on. That can achieve with the help of below:

Syntax:

If we are allowing anonymous access, ASP.NET takes the identity from IIS. If we are allowing anonymous access, this means ASP.NET will impersonate the IUSR_ComputerName account.

If we are not allowing anonymous access, ASP.NET takes the credentials of the authenticated user and makes requests for resources. Thus by turning on the impersonation and using the non-anonymous method of authentication in IIS.

We can let users log on and use their identities within your ASP.NET application.

With the above setting, all the requests are made as to the specified user.

Ex -

We can authenticate the user for a single application and use that user's identity every time someone authenticates to the application.