Solved

.NET Forms Authentication Sub-directory

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SlingPlayer alternatives 1 44
SQL Exceptions 3 43
How useful is the free version of Selenium? 3 31
SQL Help 27 40
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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 …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

805 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