ASP.net offers 3 authentication methods: Windows Authentication, forms authentication, and passport validation.
Windows Authentication: IIS performs authentication based on the settings of the application. To use this authentication method, anonymous access must be disabled in IIS.
Forms validation: Use cookies to save user credentials and redirect unauthenticated users to a custom login page.
Passport verification: Performed through a centralized authentication service in Microsoft, which provides separate logins and core profile services for member sites.
I. Configuring Windows Authentication
1) Configure IIS Settings
2) Set Web.config
<system.web>
<authentication mode = "Windows" >
<!--notifies the operating system to pass the Trust Book of the currently logged-on user to the browser-->
<authorization>
<!--prohibit anonymous users from accessing-->
<deny users = "?" />
</authorization>
</system.web>
Two. Configure Forms Identity Authentication
1) Configure Web.config
<?xml version= "1.0"?>
<!--
Note:as an alternative to hand editing this file with can use the
Web Admin tool to configure settings for your application. Use
The website->asp.net Configuration option in Visual Studio.
A full list of settings and comments can is found in
Machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings/>