Adv Web.Config Part 1
This article is A-Z Web.Config for Forms Authentication. Good for Beginners.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
<b> Advanced Web.Config for Authentication </b> <br> http://www.talha.co.uk <br><br><br> Well, After receiving so many emails asking about Web.Config, I have decided to write an article on "Web.Config for Forms Authentication". <br><br> First of all, there are three types of Authentication methods: <br><br> Windows Authentication<br> Forms Authentication<br> Passport Authentication<br> <br><br><br> Since this article is about Web.Config, I am not going to explain what the above three do, how and why? So Let's start writing a Web.Config for Forms Authentication. <br><br> In my Web.Config file, I will find my Authentication node and change it to the following: <br><br><b> <authentication mode="Forms"><br> <forms name=".ASPXAUTH" protection="All" timeout="60" loginUrl="default.aspx" /><br> </authentication><br></b> <br><br> and then I will find the Authorization node and change it as follows:<br><br> <b> <authorization><br> <deny users="?" /><br> </authorization><br> </b><br><br> If the user wants to see a restricted access, it will take him to the default.aspx page. You can change it to Login.aspx or anything. Now, another import thing to know is that not all the pages are restricted in a web application, are they? So you want to tell the program to let the users view the pages which are not. So between your <b><br><br> </system.web> and </configuration> </b> in Web.Config file, add the following lines: <br><br> <b><location path="default.aspx"><br> <system.web><br> <authorization><br> <allow users="?" /><br> </authorization><br> </system.web><br> </location><br> <br><br> <location path="login.aspx"><br> <system.web><br> <authorization><br> <allow users="?" /><br> </authorization><br> </system.web><br> </location><br> </b><br><br> Now it will let the users view default.aspx and login.aspx. If you want to add more pages, copy and paste the above lines and change the name of the pages. <br><br> My next article will be on Forms Authentication and come with Samples. So please vote and motivate me to take some time out and write it for you. Visit my web site for articles, my online projects, E-PDF Creator, E-Chat, E-Messenger and E-Charts. A good site for newbies. http://www.talha.co.uk <br><br><br>
Original Comments (3)
Recovered from Wayback Machine