Solved

.NET Forms Authentication Sub-directory

Posted on 2004-03-25
4
243 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now