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 / December 2007

Tip: Looking for answers? Try searching our database.

Authenticate users in https virtual directory and get authenticated     user back

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
manuel.ricca@gmail.com - 04 Dec 2007 19:38 GMT
Hello all,

I am trying to create a virtual directory where a user can
authenticate securely (via SSL) and then get back to the normal HTTP
site.
First I created a new virtual directory called members and required
SSL for it. I created a new ASP.NET application at members and put the
necessary stuff in web.config:

   <system.web>
     <authentication mode="Forms" />
     <compilation defaultLanguage="c#" />
     <authorization>
       <allow roles="Customer"/>
       <deny users="*"/>
     </authorization>
   </system.web>

This works but when a user goes back to the HTTP site I don't get
anything in Page.User.Idenitity.
So I tried putting everything back in the main application (removed
the members application from IIS) and added this to the main
web.config:

  <authentication mode="Forms">
     <forms loginUrl="https://server/members/login.aspx"/>
  </authentication>
 <location path="members">
   <system.web>
     <authentication mode="Forms"/>
     <authorization>
       <allow roles="Customer"/>
       <deny users="*"/>
     </authorization>
   </system.web>
 </location>

However, members is only accessible via HTTPS and the location doesn't
apply (because it's only expecting http://server/members and not
https://server/members). This means that the user won't get redirected
to my login URL. It is not allowed to put an absolute URL in location
tags (which would be <location path="https://server/members"> so it
seems I'm stuck.

Does anyonone have a solution for this? I'm thinking of getting back
to the 2 applications solution and passing the user information to the
HTTP site somehow (any ideas?).

Thanks in advance,

Manuel Ricca
Manuel Ricca - 13 Dec 2007 11:46 GMT
On Dec 4, 7:38 pm, "manuel.ri...@gmail.com" <manuel.ri...@gmail.com>
wrote:
> Hello all,
>
[quoted text clipped - 46 lines]
>
> ManuelRicca

In case anyone reads this I think it might help.

I finally got it working. Login.aspx must be outside the protected
members directory. I had just assumed that .NET would bypass
membership enforcement for loginURL but it doesn't. So I guess it
wasn't allowing access to login.aspx because login.aspx itself was in
the location allowed only for a certain role (and for which it was
configured as loginURL).

Manuel Ricca

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.