Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.NET Forms Authentication Sub-directory

Posted on 2004-03-25
4
Medium Priority
?
250 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 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

916 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