Forms Authentication for particular folder

V

VIC

Hi,

I'm working on a webapplication, most part is for anonymous access, but for
one part login is needed. All the files after login are in one particual
folder: "/login".

Usernames and passwords are stored in a tabel on SQL Server.
The loginpage and Web.config are in the root of the web.

I've tried several things but I don't get it work correctly.
My code of checking against the table works correctly, I'm struggling with
Web.config.

The authentication section of Web.config is like:

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

All I want to manage is to allow anonymous acces for the whole website,
except the content of the subfolder "/login".
Any help is appreciated, thanks!

VicWare
Email: info@vicREMOVE-MEware (spamblock)
 
K

Ken Schaefer

You need to create a new <location> in your web.config and point it to your
folder. Configure forms auth for that location only

Cheers
Ken


: Hi,
:
: I'm working on a webapplication, most part is for anonymous access, but
for
: one part login is needed. All the files after login are in one particual
: folder: "/login".
:
: Usernames and passwords are stored in a tabel on SQL Server.
: The loginpage and Web.config are in the root of the web.
:
: I've tried several things but I don't get it work correctly.
: My code of checking against the table works correctly, I'm struggling with
: Web.config.
:
: The authentication section of Web.config is like:
:
: <authentication mode="Forms">
: <forms name="justaname"
: path="/"
: loginUrl="login.aspx"
: protection="All"
: timeout="20">
: </forms>
: </authentication>
:
: All I want to manage is to allow anonymous acces for the whole website,
: except the content of the subfolder "/login".
: Any help is appreciated, thanks!
:
: VicWare
: Email: info@vicREMOVE-MEware (spamblock)
:
:
 
R

ranganh

Dear VIC,

You need to add the following code to your web.config file.

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

Hope it helps.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top