Avatar of FTIISD
FTIISD asked on

.NET Forms Authentication Sub-directory

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.
.NET Programming

Avatar of undefined
Last Comment
dfiala13

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
dfiala13

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
dfiala13

It will deny anonymous users to any page in that directory
ASKER
FTIISD

Who'd have thought it would be that easy...

Thanks man
dfiala13

You're welcome.  That's one of the tedious chores that ASP.NET has definitely made easier.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy