Sharing Forms Authentication between application and sub-application

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Sharing Forms Authentication between application and sub-application

    Hi,

    I'm succesfully using Forms Authentication on a site I'm working on
    (MyMainApp).

    In a subfolder of this site, I have a seperate ASP.NET application
    (MySubApp), i.e. it's running as an application in IIS, although it's
    part of the MyMainApp VS.NET project file. The structure is something
    like this:

    MyMainApp <!-- Application in IIS
    \MySubApp <!-- Application in IIS
    \images
    \mySubAppFiles
    web.config
    \images
    \includes
    \MainAppSubFolder
    web.config
    logon.aspx, etc.

    All other folders are simple virtual directories. If I try browsing
    to any .aspx page in a subfolder of MyMainApp (excluding files in
    MySubApp) it forces me to the login page, as it should do. However,
    if I try to browse to any .aspx page in MySubApp by typing the address
    in IE it brings up the page, seemingly bypassing the Forms
    Authentication which is applied on both the web.config files of
    MyMainApp and MySubApp. Within MySubApp the relevant section of
    web.config looks like this:

    <authentication mode="Forms">
    <forms name=".MYAPP"
    loginUrl="../logon.aspx"
    protection="All"
    timeout="20"
    path="/"/>
    </authentication>

    Does anyone know why the Forms Authentication on MySubApp is being
    bypassed completely?

    Thanks,

    Brian
    =B= Guest

  2. Similar Questions and Discussions

    1. Sharing Flash application for multiple (2) users
      Hello, I have a Flash application which i want to expand with a sort of Helpdesk feature. What i want is that when the user pressed the button...
    2. Forms Authentication to protect a cgi application
      I have enabled forms authentication on an IIS 6 W2k3 server to protect access to the application files until authenticated. The actual...
    3. Forms Authentication to protect .cgi application problem
      I have enabled forms authentication on an IIS 6 W2k3 server to protect access to the application files until authenticated. The actual...
    4. Restrict access to resources like .doc, .ppt etc in .net forms authentication application
      Hi, We are developing a .NET app which has forms authentication. When the user types in the direct URL which is an aspx page, he will be thrown...
    5. How to inherit a base form in all application forms of an asp.net application
      hello friend, while developing an asp.net application, i created a base form(say mybaseform1) with certain links on it. then i tried to...
  3. #2

    Default Re: Sharing Forms Authentication between application and sub-application

    I imagine your path attribute in your sub-webconfig is messing you up. Sure it is not looking at your main application's authentication cookie, and that is why it is letting you in?

    Here is an article on sharing forms authentication, might help..

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformsauthenticationacrossapplications.asp[/url]




    "=B=" <brian_is_online@yahoo.co.uk> wrote in message news:46537b79.0501130458.152db7ac@posting.google.c om...
    > Hi,
    >
    > I'm succesfully using Forms Authentication on a site I'm working on
    > (MyMainApp).
    >
    > In a subfolder of this site, I have a seperate ASP.NET application
    > (MySubApp), i.e. it's running as an application in IIS, although it's
    > part of the MyMainApp VS.NET project file. The structure is something
    > like this:
    >
    > MyMainApp <!-- Application in IIS
    > \MySubApp <!-- Application in IIS
    > \images
    > \mySubAppFiles
    > web.config
    > \images
    > \includes
    > \MainAppSubFolder
    > web.config
    > logon.aspx, etc.
    >
    > All other folders are simple virtual directories. If I try browsing
    > to any .aspx page in a subfolder of MyMainApp (excluding files in
    > MySubApp) it forces me to the login page, as it should do. However,
    > if I try to browse to any .aspx page in MySubApp by typing the address
    > in IE it brings up the page, seemingly bypassing the Forms
    > Authentication which is applied on both the web.config files of
    > MyMainApp and MySubApp. Within MySubApp the relevant section of
    > web.config looks like this:
    >
    > <authentication mode="Forms">
    > <forms name=".MYAPP"
    > loginUrl="../logon.aspx"
    > protection="All"
    > timeout="20"
    > path="/"/>
    > </authentication>
    >
    > Does anyone know why the Forms Authentication on MySubApp is being
    > bypassed completely?
    >
    > Thanks,
    >
    > Brian
    Raterus Guest

  4. #3

    Default Re: Sharing Forms Authentication between application and sub-application

    Try to use an absolute url on your path attribute.
    Here is another article about this topic.

    [url]http://weblogs.asp.net/hernandl/archive/2004/06/09/ssoformsauth.aspx[/url]


    --
    Hernan de Lahitte
    [url]http://weblogs.asp.net/hernandl[/url]
    [url]http://www.lagash.com/english/index.html[/url]


    "Raterus" <raterus@hotmail.com> wrote in message
    news:OM0J4Fm%23EHA.3592@TK2MSFTNGP09.phx.gbl...
    I imagine your path attribute in your sub-webconfig is messing you up. Sure
    it is not looking at your main application's authentication cookie, and that
    is why it is letting you in?

    Here is an article on sharing forms authentication, might help..

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformsauthenticationacrossapplications.asp[/url]




    "=B=" <brian_is_online@yahoo.co.uk> wrote in message
    news:46537b79.0501130458.152db7ac@posting.google.c om...
    > Hi,
    >
    > I'm succesfully using Forms Authentication on a site I'm working on
    > (MyMainApp).
    >
    > In a subfolder of this site, I have a seperate ASP.NET application
    > (MySubApp), i.e. it's running as an application in IIS, although it's
    > part of the MyMainApp VS.NET project file. The structure is something
    > like this:
    >
    > MyMainApp <!-- Application in IIS
    > \MySubApp <!-- Application in IIS
    > \images
    > \mySubAppFiles
    > web.config
    > \images
    > \includes
    > \MainAppSubFolder
    > web.config
    > logon.aspx, etc.
    >
    > All other folders are simple virtual directories. If I try browsing
    > to any .aspx page in a subfolder of MyMainApp (excluding files in
    > MySubApp) it forces me to the login page, as it should do. However,
    > if I try to browse to any .aspx page in MySubApp by typing the address
    > in IE it brings up the page, seemingly bypassing the Forms
    > Authentication which is applied on both the web.config files of
    > MyMainApp and MySubApp. Within MySubApp the relevant section of
    > web.config looks like this:
    >
    > <authentication mode="Forms">
    > <forms name=".MYAPP"
    > loginUrl="../logon.aspx"
    > protection="All"
    > timeout="20"
    > path="/"/>
    > </authentication>
    >
    > Does anyone know why the Forms Authentication on MySubApp is being
    > bypassed completely?
    >
    > Thanks,
    >
    > Brian

    Hernan de Lahitte Guest

  5. #4

    Default Re: Sharing Forms Authentication between application and sub-application

    Thanks for all the help. The absolute URL did the trick!

    B.

    Hernan de Lahitte wrote:
    > Try to use an absolute url on your path attribute.
    > Here is another article about this topic.
    >
    > [url]http://weblogs.asp.net/hernandl/archive/2004/06/09/ssoformsauth.aspx[/url]
    >
    >
    > --
    > Hernan de Lahitte
    > [url]http://weblogs.asp.net/hernandl[/url]
    > [url]http://www.lagash.com/english/index.html[/url]
    >
    >
    > "Raterus" <raterus@hotmail.com> wrote in message
    > news:OM0J4Fm%23EHA.3592@TK2MSFTNGP09.phx.gbl...
    > I imagine your path attribute in your sub-webconfig is messing you
    up. Sure
    > it is not looking at your main application's authentication cookie,
    and that
    > is why it is letting you in?
    >
    > Here is an article on sharing forms authentication, might help..
    >
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformsauthenticationacrossapplications.asp[/url]
    >
    >
    >
    >
    > "=B=" <brian_is_online@yahoo.co.uk> wrote in message
    > news:46537b79.0501130458.152db7ac@posting.google.c om...
    > > Hi,
    > >
    > > I'm succesfully using Forms Authentication on a site I'm working on
    > > (MyMainApp).
    > >
    > > In a subfolder of this site, I have a seperate ASP.NET application
    > > (MySubApp), i.e. it's running as an application in IIS, although
    it's
    > > part of the MyMainApp VS.NET project file. The structure is
    something
    > > like this:
    > >
    > > MyMainApp <!-- Application in IIS
    > > \MySubApp <!-- Application in IIS
    > > \images
    > > \mySubAppFiles
    > > web.config
    > > \images
    > > \includes
    > > \MainAppSubFolder
    > > web.config
    > > logon.aspx, etc.
    > >
    > > All other folders are simple virtual directories. If I try
    browsing
    > > to any .aspx page in a subfolder of MyMainApp (excluding files in
    > > MySubApp) it forces me to the login page, as it should do.
    However,
    > > if I try to browse to any .aspx page in MySubApp by typing the
    address
    > > in IE it brings up the page, seemingly bypassing the Forms
    > > Authentication which is applied on both the web.config files of
    > > MyMainApp and MySubApp. Within MySubApp the relevant section of
    > > web.config looks like this:
    > >
    > > <authentication mode="Forms">
    > > <forms name=".MYAPP"
    > > loginUrl="../logon.aspx"
    > > protection="All"
    > > timeout="20"
    > > path="/"/>
    > > </authentication>
    > >
    > > Does anyone know why the Forms Authentication on MySubApp is being
    > > bypassed completely?
    > >
    > > Thanks,
    > >
    > > Brian
    brian_is_online@yahoo.co.uk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139