<forms name="CompanyWeb" loginUrl="login.aspx" protection="All" path="/" />

Discussion in 'ASP .Net' started by Murphy, Apr 18, 2004.

  1. Murphy

    Murphy Guest

    Our website contains subdirectories for each subsidiary company, each
    company has it's own look and feel to the pages in their subdirectory
    although they are all part of the main website.

    The code below in the Web.Config file defines the authentication as forms
    and the aspx file required for login if the user is unauthenticated... this
    works well for the root level company web pages however when a user viewing
    the website of SubCompanyA tries to access a secured page such as the
    PasswordChange.aspx page as listed below they are always redirected back to
    the login.aspx page at the root level. Instead I would like
    SubCompanyA/PasswordChange.aspx to redirect the user to
    SubCompanyA/login.aspx etc

    Is this possible and how can I implement it ?

    Thanks

    Murphy

    <authentication mode="Forms">
    <forms name="CompanyWeb" loginUrl="login.aspx" protection="All" path="/"
    />
    </authentication>


    <location path="PasswordChange.aspx">
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </location>
    <location path="SubCompanyA/PasswordChange.aspx">
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </location>
    <location path="SubCompanyB/PasswordChange.aspx">
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </location>
    Murphy, Apr 18, 2004
    #1
    1. Advertising

  2. Murphy

    Pete Beech Guest

    Could you, in the main login page, examine the GetRedirecUrl, and based on
    that (i.e. if the URL is in SubCompanyA or SubCompanyB) redirect to the
    appropriate login page. You'd have to preserve the query string with the
    RedirectURL value, but I guess the FormsAuthentication methods would still
    work. (However, I've never tried it.)

    Pete Beech

    "Murphy" <> wrote in message
    news:...
    > Our website contains subdirectories for each subsidiary company, each
    > company has it's own look and feel to the pages in their subdirectory
    > although they are all part of the main website.
    >
    > The code below in the Web.Config file defines the authentication as forms
    > and the aspx file required for login if the user is unauthenticated...

    this
    > works well for the root level company web pages however when a user

    viewing
    > the website of SubCompanyA tries to access a secured page such as the
    > PasswordChange.aspx page as listed below they are always redirected back

    to
    > the login.aspx page at the root level. Instead I would like
    > SubCompanyA/PasswordChange.aspx to redirect the user to
    > SubCompanyA/login.aspx etc
    >
    > Is this possible and how can I implement it ?
    >
    > Thanks
    >
    > Murphy
    >
    > <authentication mode="Forms">
    > <forms name="CompanyWeb" loginUrl="login.aspx" protection="All"

    path="/"
    > />
    > </authentication>
    >
    >
    > <location path="PasswordChange.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="SubCompanyA/PasswordChange.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="SubCompanyB/PasswordChange.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > </location>
    >
    >
    >
    Pete Beech, Apr 18, 2004
    #2
    1. Advertising

  3. Murphy

    hwang Guest

    hi

    i think you can put another web.config in your subcompany's dictionary
    "Murphy" <> дÈëÏûÏ¢ÐÂÎÅ
    :...
    > Our website contains subdirectories for each subsidiary company, each
    > company has it's own look and feel to the pages in their subdirectory
    > although they are all part of the main website.
    >
    > The code below in the Web.Config file defines the authentication as forms
    > and the aspx file required for login if the user is unauthenticated...

    this
    > works well for the root level company web pages however when a user

    viewing
    > the website of SubCompanyA tries to access a secured page such as the
    > PasswordChange.aspx page as listed below they are always redirected back

    to
    > the login.aspx page at the root level. Instead I would like
    > SubCompanyA/PasswordChange.aspx to redirect the user to
    > SubCompanyA/login.aspx etc
    >
    > Is this possible and how can I implement it ?
    >
    > Thanks
    >
    > Murphy
    >
    > <authentication mode="Forms">
    > <forms name="CompanyWeb" loginUrl="login.aspx" protection="All"

    path="/"
    > />
    > </authentication>
    >
    >
    > <location path="PasswordChange.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="SubCompanyA/PasswordChange.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="SubCompanyB/PasswordChange.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > </location>
    >
    >
    >
    hwang, Apr 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hermit Dave
    Replies:
    9
    Views:
    557
    Hermit Dave
    Jan 13, 2004
  2. Hermit Dave
    Replies:
    0
    Views:
    461
    Hermit Dave
    Jan 13, 2004
  3. gabe

    How to read Forms LoginURL?

    gabe, Nov 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    353
  4. Daniel Fisher\(lennybacon\)

    Re: How to read Forms LoginURL?

    Daniel Fisher\(lennybacon\), Nov 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    556
  5. Alexey Smirnov

    Re: <forms loginUrl="https:// pb

    Alexey Smirnov, Jun 25, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    608
    Alexey Smirnov
    Jun 25, 2009
Loading...

Share This Page