473,385 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Password protect/Forms authentication method

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.

Nov 19 '05 #1
4 2550
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?

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"su*******@gmail.com" wrote:
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.

Nov 19 '05 #2
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.

Nov 19 '05 #3
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.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"su*******@gmail.com" wrote:
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.

Nov 19 '05 #4
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-

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wm | last post by:
Something just occurred to me... <yeah, I know, it scared me too> I just password-protected a website by including a password authentication script in each page of a private section. The script...
7
by: juglesh | last post by:
<body><div align="center"> <?php if (!isset($password)){ ?><form action="<?php $_SERVER; ?>" method="post"> type password here&nbsp;<input name="password" type="text" size="8"> then <input...
5
by: Brent Burkart | last post by:
I want to protect my website with a user and password. I have SQL Server 2000 where I want to store the users and passwords and the website is complete. I just need to add in some security with...
4
by: Tim Zych | last post by:
I want to password protect my site. In order to access it, one would have to login with a username and password. How can I do that?
5
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and...
2
by: Ronald S. Cook | last post by:
We have our app deployed so that users may download from www.oursite.com/ourapp. But how can we password protect or do any sort of security on this? One of our developers has argued that...
1
by: Ronald S. Cook | last post by:
In my ASP.NET 2.0 Web app, I want to make some files inaccessible to unauthenticated users. Using Forms Authentication, this works fine for ..aspx pages, but not for regular old .htm pages. How...
5
by: nick | last post by:
I need to create a simple asp.net application that use password protect some html pages. The html page provider doesn't know asp.net. And the host doesn't allow me to create user accounts. ...
2
by: dancer | last post by:
Can you create a password protected page with JUST asp.net and VB2005? I don't want to use javascript.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.