RE: Secure Multiple Applications in one Domain

From: Steven Cheng[MSFT] (v-schang_at_online.microsoft.com)
Date: 05/15/04


Date: Sat, 15 May 2004 08:42:05 GMT

Hi Joe,

>From your description,you have a root web application which contains
another sub application located in the
root applicaiton 's root folder in IIS. The root application is using the
form authenticaiton and protected the files from
unauthenticated users. Now you want the sub application's file also be
protected from unauthenticated users and
use the same login page in the root web application. However, this works
well when you visiting the pages in root application. However, when you
visit the page in the sub application and be redirected to the login page
and after the user login and use
FormsAuthenticatoins.RedirectFromLoginPage to redirect to the former
requested page, you found you are still get redirected to the login page,
yes?

As for this problem, here are some of my suggestions:
1. Regarding on the repeatly be redirect to login page. I think the problem
is likely caused by the login page is not in the same site. When you visit
the sub app and be redirected to the parent web application's
login page and that make the former requested url became the "login" page
rather than the certain page in the sub web app. So that when you submit
and call the FormsAuthenticatoins.RedirectFromLoginPage
you will be repeatly redirect to the login page. I suggest you look at the
url in the browser's address bar when be redirected to the login page first
time
 or use Response.Write("<br>" +
FormsAuthentication.GetRedirectUrl("username",false)); to output the url to
confirm this.

2. Since you want the sub app under the root application also use the
authentication and authorization setting in the root web app, we don't need
to create a sub applicatin, just make it a normal sub folder under the root
applicaiton. And that'll also avoid may other issues with multi application
with parent-sub folder structure. Also, we can specify heirarchy
configuration setting in the root app's web.config without provide a
web.config for each sub folder and here are some related references in msdn:

#Configuration Inheritance
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconconfigurationinher
itance.asp?frame=true

#Configuration <location> Settings
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconconfigurationlocat
ionsettings.asp?frame=true

#Locking Configuration Settings
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconlockingconfigurati
onsettings.asp?frame=true

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx



Relevant Pages

  • Re: Secure Multiple Applications in one Domain
    ... Original Page, Login Page, Post of Login Page, Original Page, ... Is using the element in my root web's web.config file the way to ... > another sub application located in the ... Regarding on the repeatly be redirect to login page. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Redirecting Users...
    ... root portal page to redirect the user (you would hav eto have logic to ... the root site from another page). ... Microsoft MVP - SharePoint Portal Server ... > Also, I have this simple form for login the OWA WebParts, is it possible ...
    (microsoft.public.sharepoint.portalserver)
  • Problem with detecting cookie
    ... I have a asp.net page that checks if any one of the two cookies exists. ... none of the cookies exist then redirect the user to login page. ... Sub page_load ...
    (microsoft.public.dotnet.framework.aspnet)
  • Forms authentication doesnt work in IIS6!!!
    ... I login the user in my root application, and this code runs in the global.asax: ... The redirect to the protected folder happens, but in the application in the ...
    (microsoft.public.inetserver.iis)
  • Re: Forms authentication doesnt work in IIS6!!!
    ... >I login the user in my root application, and this code runs in the ... > The redirect to the protected folder happens, ... > protected folder Request.IsAuthenticated returns FALSE! ...
    (microsoft.public.inetserver.iis)