Solved

.NET Forms Authentication Sub-directory

Posted on 2004-03-25
4
246 Views
Last Modified: 2006-11-17
Greetings!

I have an web application that has been working great....  until now.  I've got a ton of pages that need to be secure using the forms authentication.

I've been adding;

<location path="editCompanyLogo.aspx"><system.web><authorization><deny users="?" />
                  </authorization></system.web></location>

for each page, but the problem is that that is getting a little too tedius....  so I know you can cause authentication for an entire directory, so I removed all the location tags, moved all the files that are for "members" into the /members directory,  and added the following

<authentication mode="Forms">
            <forms name=".members" path="/" loginUrl="login.aspx" protection="All" timeout="15" />
      </authentication>

Basically I want to restrict anonymous access to any aspx page inside the member/ directory which is a sub directory of my web app.
0
Comment
Question by:FTIISD
  • 3
4 Comments
 
LVL 12

Accepted Solution

by:
dfiala13 earned 500 total points
ID: 10681515
Put this below your system.web tag in the web.config file

<location path="members">
        <system.web>
            <authorization>
                <deny users="?" />
            </authorization>
        </system.web>
0
 
LVL 12

Expert Comment

by:dfiala13
ID: 10681532
It will deny anonymous users to any page in that directory
0
 

Author Comment

by:FTIISD
ID: 10681634
Who'd have thought it would be that easy...

Thanks man
0
 
LVL 12

Expert Comment

by:dfiala13
ID: 10681675
You're welcome.  That's one of the tedious chores that ASP.NET has definitely made easier.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 Publish Error 2 34
SSIS Feed MS SQL Server Stored procedure with loop 4 38
Finding the IIS version 5 22
abstract class C# 1 31
IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question