Password protect/Forms authentication method

S

sunniyeow

Hi, My question is regarding password protecting 2 different folders
inside a single virtual directory using forms authentication method.
Easier if I illustrate things out...

- <authentication mode="Forms">
- Virtual Directory aka Top Level Root = /mysite
- Inside /mysite I have 2 sub-folders which I want to password protect
= /adminonly and /memberonly
- /adminonly is assigned to a single Admin user with a hard-coded pair
of username and password
- /memberonly username and password values are taken from a database,
therefore are dynamic
- I have 2 separate login pages called
/mysite/adminonly/adminlogin.aspx and /mysite/memberlogin.aspx

I have no problems getting things to work for each individual folder
(therefore my programming codes are correct) BUT I cannot get it to
work with both sub-folders at the same time under the same virtual
directory. I am getting very confused with my web.config,
<authorization>, <location path="adminonly">, <location
path="memberonly">, etc. settings.

Please help clear my confusion. Thanks.
 
G

Guest

Hi Sunni,

What exactly did you mean "BUT I cannot get it to
work with both sub-folders at the same time under the same virtual
directory."?

One more question: was there any reason to have used a separate login page
for members and admins?
 
S

sunniyeow

Hi,

What I mean by that is...IF I want to only password protect 1
sub-folder, my programming codes work perfectly. BUT I am not able to
password protect 2 sub-folders at the same time.

Regarding the separate login page - no reason other than my own
preference. But I have indeed thought about this issue too. Maybe if I
use only 1 single login page, things will work for me?

Thanks.
 
G

Guest

Hi,

You need have only one login page.

Depending upon the security roles you have specified, you could prevent
admin from accessing membersonly area etc.

Let me know if you need more assistance.
 
S

sunniyeow

Hi Rakesh,

Looks like we're heading in the right direction. Ok on only 1 single
login page.
I understand what you mean by assigning different security roles but my
..Net skills isn't up to par to pulling that off.

Yes, it would be great if you can provide me with a sample web.config
file with the security roles concept based on my requirements.

Thanks Rakesh for your time.
-Sun Ni-
 

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top