473,387 Members | 1,757 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,387 software developers and data experts.

ASP.NET 2.0 Form Authentication in different folders- problem

Hi,

I have the following structure of my web-site
root
|
-folder1 (secure)
|
-folder2 (secure)

Now, as you can see, both folders are secure and need to have
different login forms (one login form will have only password
field!!!) How can I do this, or in other words, how should I change my
web.config files in root, folder1 and folder2 directories. Root folder
is public. I don't want to add virtual directories!

Thanks in advance!

D

Jun 24 '07 #1
5 4813
I think what you should really be doing is have *one* login form, and attach
the user's role from the database table (or using a Roles Provider).
Then all you need is two <location path="yourfolder1" elements and <allow
roles="xxx" subelements in your web.config.

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"drasko" wrote:
Hi,

I have the following structure of my web-site
root
|
-folder1 (secure)
|
-folder2 (secure)

Now, as you can see, both folders are secure and need to have
different login forms (one login form will have only password
field!!!) How can I do this, or in other words, how should I change my
web.config files in root, folder1 and folder2 directories. Root folder
is public. I don't want to add virtual directories!

Thanks in advance!

D

Jun 25 '07 #2
On Jun 25, 3:15 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
I think what you should really be doing is have *one* login form
Thank you for your answer. But I really need two login forms. Or, can
I do some workaround with only one login form to achieve goals
described in previous letter?

D

Jun 25 '07 #3
re:
!I really need two login forms.

No, you don't... ;-)

re:

!Or, can I do some workaround with only one login form to achieve goals
!described in previous letter?

Indeed, you can.

Look into the <location...web.config element :

http://support.microsoft.com/kb/316871

http://msdn2.microsoft.com/en-us/lib...92(VS.80).aspx

Configure your secure locations in the root web.config...

http://msdn2.microsoft.com/en-us/library/aa302435.aspx

Check the "authentication" section :

<forms loginUrl="Restricted\login.aspx"
protection="All"
requireSSL="true"
timeout="10"
name="AppNameCookie"
path="/FormsAuth"
slidingExpiration="true" />


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"drasko" <dr*********@gmail.comwrote in message
news:11**********************@n60g2000hse.googlegr oups.com...
On Jun 25, 3:15 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
>I think what you should really be doing is have *one* login form

Thank you for your answer. But I really need two login forms. Or, can
I do some workaround with only one login form to achieve goals
described in previous letter?

D

Jun 25 '07 #4
Precisely! :)
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"Juan T. Llibre" wrote:
re:
!I really need two login forms.

No, you don't... ;-)

re:

!Or, can I do some workaround with only one login form to achieve goals
!described in previous letter?

Indeed, you can.

Look into the <location...web.config element :

http://support.microsoft.com/kb/316871

http://msdn2.microsoft.com/en-us/lib...92(VS.80).aspx

Configure your secure locations in the root web.config...

http://msdn2.microsoft.com/en-us/library/aa302435.aspx

Check the "authentication" section :

<forms loginUrl="Restricted\login.aspx"
protection="All"
requireSSL="true"
timeout="10"
name="AppNameCookie"
path="/FormsAuth"
slidingExpiration="true" />


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"drasko" <dr*********@gmail.comwrote in message
news:11**********************@n60g2000hse.googlegr oups.com...
On Jun 25, 3:15 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
I think what you should really be doing is have *one* login form
Thank you for your answer. But I really need two login forms. Or, can
I do some workaround with only one login form to achieve goals
described in previous letter?

D


Jun 26 '07 #5
On Jun 26, 12:34 am, "Juan T. Llibre" <nomailrepl...@nowhere.com>
wrote:
re:
!I really need two login forms.

No, you don't... ;-)
Ok, these are good news... :) Thank you!!!!

>
re:

!Or, can I do some workaround with only one login form to achieve goals
!described in previous letter?

Indeed, you can.

Look into the <location...web.config element :

http://support.microsoft.com/kb/316871

http://msdn2.microsoft.com/en-us/lib...92(VS.80).aspx

Configure your secure locations in the root web.config...

http://msdn2.microsoft.com/en-us/library/aa302435.aspx

Check the "authentication" section :

<forms loginUrl="Restricted\login.aspx"
protection="All"
requireSSL="true"
timeout="10"
name="AppNameCookie"
path="/FormsAuth"
slidingExpiration="true" />

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
======================================"drasko" <draskosa...@gmail.comwrote in message

news:11**********************@n60g2000hse.googlegr oups.com...
On Jun 25, 3:15 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
I think what you should really be doing is have *one* login form
Thank you for your answer. But I really need two login forms. Or, can
I do some workaround with only one login form to achieve goals
described in previous letter?
D

Jun 27 '07 #6

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

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
2
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having...
4
by: Paul | last post by:
Background. We have a corporate intranet that is (as much as makes no difference) entirely IIS web servers & IE browsers. We use a standard Windows domain logon and use active directory. We...
4
by: MR. UNDERHILL | last post by:
I want to use forms authentication on my website. Looking at the documentation, I create a sample site for testing. One of my requirements is to ensure that SOME pages required an authenticated...
4
by: Andrew | last post by:
Hey all, I would like to preface my question by stating I am still learning ASP.net and while I am confident in the basics and foundation, the more advanced stuff is still a challenge. Ok....
2
by: Thomas Scheiderich | last post by:
I am trying to set up forms authentication in my IIS pages. I have a folder inside of my root folder I am trying to protect and I am getting an error when a page in the folder is accessed. The...
4
by: nicholas | last post by:
Hi, Got an asp.net application and I use the "forms" authentication mode defined in the web.config file. Everything works fine. But now I would like to add a second, different login page for...
0
by: Walter W | last post by:
I have a web app which contains two sections: a User front end and a Administration Back end. Both sections require a user to first log in. a general user logs into the front section, a system...
4
by: sunniyeow | last post by:
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...
6
by: danielevans | last post by:
Hi Is it possible with forms authentication to have two seperate areas that need users to register for both for access. For example, i have a /trade/ directory and a /game/ directory. I need to...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.