473,725 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms Authentication - how to exclude certain files

I have a site which uses forms authentication but I would
like to exclude certain pages on the site from
authentication. In other words I would like the user to be
able to get to these pages without having to Log In.
How do I change my web.config file to exclude certain
files.

<authenticati on mode = "Forms">
<forms name = ".ASPX" loginURL="Authe nticate.aspx"
protection = "All" path="/" />
</authentication>

Thanks.
Nov 17 '05 #1
2 4459
You can specify which files and folders to allow to which users in your
web.config file by using the <location> tag.

Here is an example link with sample code that you can download and play
with.
http://www.dotnetbips.com/displayarticle.aspx?id=117

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------

"Peter" <sw*******@yaho o.com> wrote in message
news:04******** *************** *****@phx.gbl.. .
I have a site which uses forms authentication but I would
like to exclude certain pages on the site from
authentication. In other words I would like the user to be
able to get to these pages without having to Log In.
How do I change my web.config file to exclude certain
files.

<authenticati on mode = "Forms">
<forms name = ".ASPX" loginURL="Authe nticate.aspx"
protection = "All" path="/" />
</authentication>

Thanks.

Nov 17 '05 #2
You can put a different web.config in each folder, and the settings on the
child folder will override those on the parent. Just create a directory of
pages that don't need to be secured, and change the web.config on this
directory to allow non-authenticated users to access it.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
"Peter" <sw*******@yaho o.com> wrote in message
news:04******** *************** *****@phx.gbl.. .
I have a site which uses forms authentication but I would
like to exclude certain pages on the site from
authentication. In other words I would like the user to be
able to get to these pages without having to Log In.
How do I change my web.config file to exclude certain
files.

<authenticati on mode = "Forms">
<forms name = ".ASPX" loginURL="Authe nticate.aspx"
protection = "All" path="/" />
</authentication>

Thanks.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1570
by: Paul Cook | last post by:
Hi I have a website which uses forms based authentication. However, I need to exclude a file from authentication so that all users can view it. How? Thanks, Paul.
3
4868
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
1
2091
by: Martin | last post by:
Hi, After I gave up on tracking user sessions through the session object (Session_OnEnd is still not triggered by Abandon() even with mode=InProc and me manipulating session variables; in a new test project it is only triggered the first time, it really sucks pretty bad) I started looking at alternatives and I found FormsAuthentication. I just implemened it and it seems very nice. But, of course, there is a problem with it (it wouldn't...
1
1473
by: - Steve - | last post by:
I have a directory that I want to use forms based authentication on. There's a couple of pages in that directory that I want to allow anonymous access to. There's also one page that I want to allow anonymous access to, but if someone is logged in then the page would be slightly different. How can I allow anonymous access to certain files in a Forms Based Authentication protected directory? --
2
2416
by: Joe Rigley | last post by:
Help Please! I've been tasked with converting a portion of the corporate web site that currently utilizes local user accounts and NTFS via Basic Authentication to access certain files on the web site to an ASP .NET Forms Authentication approach with SQL Server. I'm just getting comfortable with ASP .Net, but strong in Classic ASP.
1
1805
by: DOTNETGUY | last post by:
How can I exclude a web form from Forms Autentication, For example lets say I need to redirect to a web form if the ip address of the client is not in my list. I cannot redirect to my error display page because of the obvious reasons. So is there anyway I can exclude certain files? To make them "public". I know if i create another VDir and redirect there it will work but is there a solution for web forms sitting in the same app folder? ...
3
1781
by: =?Utf-8?B?TWF4IFR1cmF2YW5p?= | last post by:
Hi, Is there any way I can cause a login page to appear, using Forms authentication of course, when access a particular page only. In my case, I am building a site for rental properties. There are a group of files ( HTML, ASPX files ) that are freely publicly accessable. There are certain pages however that my client will use to update their listings and images. I would like those pages ONLY to be redirected to the login page but NOT the...
0
1053
by: tagg3rx | last post by:
Hi All, I'm trying to get forms based auth up and working and I'm running into a little snag. My login page needs to access css files and images in my application and when I enable the authentication in web config access to these files are being blocked. My Webconfig auth section: <system.web> <compilation debug="true"/> <authentication mode="Forms"> <forms name=".mycookie" loginUrl="loginform.aspx"...
1
1832
by: djnokturnal | last post by:
Hey guys/gals, I have successfully implemented forms authentication on my site: <authentication mode="Forms"> <forms loginUrl="/Members/Login.aspx" timeout="20" defaultUrl="/Members/Welcome.aspx" protection="All" requireSSL="false" path="/" /> </authentication> Now I would like to restrict certain subfolders within /Members by Role. I have the following roles for testing:
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.