Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

ASP.NET 2.0 Form Authentication in different folders- problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
drasko - 24 Jun 2007 20:55 GMT
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
Peter Bromberg [C# MVP] - 25 Jun 2007 02:15 GMT
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

> Hi,
>
[quoted text clipped - 14 lines]
>
> D
drasko - 25 Jun 2007 23:08 GMT
On Jun 25, 3:15 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.com> wrote:
> 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
Juan T. Llibre - 25 Jun 2007 23:34 GMT
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/library/ms178692(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/
======================================
> On Jun 25, 3:15 am, Peter Bromberg [C# MVP]
> <pbromb...@yahoo.yabbadabbadoo.com> wrote:
[quoted text clipped - 5 lines]
>
> D
Peter Bromberg [C# MVP] - 26 Jun 2007 14:46 GMT
Precisely! :)
Signature

Site:  http://www.eggheadcafe.com
UnBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA):    http://www.blogmetafinder.com

> re:
> !> I really need two login forms.
[quoted text clipped - 41 lines]
> >
> > D
drasko - 27 Jun 2007 08:06 GMT
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:
>
[quoted text clipped - 36 lines]
>
> > D

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.