Introduction
Here I will explain a real time scenario of how windows authentication works. Before that I'll explain what authentication is. The answer is simply "to authenticate the users to access for my website/application." How is it done in ASP.NET? Not everyone can access (Anonymous) my application, since it is a web application. Security is essential to my web application.
So what are all the ways to authenticate the users to access the application? Please don't confuse this with types of authentication.
Here are the ways to authenticate users to access the application.
- Check with windows directory (Windows Authentication)
- Check with Database (Forms Authentication- not for all case)
- Check with common service provider (Passport Authentication)
Windows Authentication
I am going to explain only Windows authentication. But before that you should have knowledge about Windows directory. What is Windows directory? In real tim scenario, you have to enter your username and password to access the system in your college Lab/Library. If you enter some other name which is not valid it means you can not log in to the system. How it works is, in your college they normally maintain student details in a common directory called "windows directory." for example my name is "vetri," the password is "vetri;" they are created like that. When I access the system I have to use the above credentials.
I hope you have a clear picture of what is the windows directory is. In real time, if I am going to create the web application which is used to enter student details in the college, I can go for windows authentication for this requirement, because when students access the application they can log in to the application with their windows credentials (when you log in to the system, you have entered username and password).
Please refer to the following simple steps to create the windows authentication application.
Step 1: Open Visual Studio -> New Website -> Select your language C#/VB.Net -> ASP.NET Empty Web Site -> Enter the application name as "Sample_Windows_Auth" ->Select"OK".
Step 2: Add one web form to the website by right click on the website and select Add -> Webform1.aspx

After that Set WebForm1.aspx is "Set as Start Page" by right clicking on that page and choosing the option.
Step 3: Select Web.Config file from the solution explorer and add the following piece of code under <System.Web>,
- <authentication mode="Windows">
- </authentication>








Bipin jainPosted Feb 27, 2018, 11:45 PM
Hi, I have here one confusion using windows authentication. I need to apply windows authentication in my application. So first I need to know what is the impact which I have used 3rd party API in my application any made impact on my 3rd party API usage.For example I have used 3rd party API for invoice generate. so can you please help me.
Vetri Chelvan IndrajithPosted Apr 6, 2016, 3:08 AM
hi, i have tried it out whatever you said in my local machine. even i changed my apppool identity the application still is working fine with windows authentication. i changed to "LocalService"
Vetri Chelvan IndrajithPosted Apr 2, 2016, 9:10 AM
Hi maruthi, sorry for the delayed response. Shall I rephrase your sentence if my understanding is correct. You want to me say that I have to change app pool identity from "apppoolidentity" to some other (local service, local system) like this
Maruthi PalllamalliPosted Mar 31, 2016, 2:19 AM
Can you check it once change your app pool identity and can you explain how windows authentication works internally ?
Pavithran NPosted Mar 28, 2016, 5:46 AM
Well Explained.
Vignesh ManiPosted Mar 28, 2016, 5:24 AM
Nice
Vetri Chelvan IndrajithPosted Mar 28, 2016, 5:01 AM
Thanks for your all valuable feedback. I am really happy for your appreciate. I am looking forward you to support me for upcoming articles
Mohammed IbrahimPosted Mar 28, 2016, 4:09 AM
nice
Anu VPosted Mar 28, 2016, 1:07 AM
Nice
Sibeesh VenuPosted Mar 28, 2016, 12:57 AM
Welcome dude, it is great to see you here.
Debasis SahaPosted Mar 28, 2016, 12:36 AM
Good One..
Jaipal ReddyPosted Mar 28, 2016, 12:26 AM
Nice start. .
Humayun Kabir MamunPosted Mar 27, 2016, 11:47 PM
Nice...