Forms authentication for certain pages

Discussion in 'ASP .Net' started by =?Utf-8?B?TWF4IFR1cmF2YW5p?=, Feb 6, 2007.

  1. Hi,

    Is there any way I can cause a login page to appear, using Forms
    authentication of course, when access a particular page only. In my case, I
    am building a site for rental properties. There are a group of files ( HTML,
    ASPX files ) that are freely publicly accessable. There are certain pages
    however that my client will use to update their listings and images. I would
    like those pages ONLY to be redirected to the login page but NOT the publicly
    accessible files. Is there a way to target URL redirection using forms
    authentication for certain files that you specify.

    Thanks,

    Max
     
    =?Utf-8?B?TWF4IFR1cmF2YW5p?=, Feb 6, 2007
    #1
    1. Advertising

  2. "Max Turavani" <> wrote in message
    news:...
    > Hi,
    >
    > Is there any way I can cause a login page to appear, using Forms
    > authentication of course, when access a particular page only. In my case,
    > I
    > am building a site for rental properties. There are a group of files (
    > HTML,
    > ASPX files ) that are freely publicly accessable. There are certain pages
    > however that my client will use to update their listings and images. I
    > would
    > like those pages ONLY to be redirected to the login page but NOT the
    > publicly
    > accessible files. Is there a way to target URL redirection using forms
    > authentication for certain files that you specify.
    >
    > Thanks,
    >
    > Max


    Hi Max,

    Just put all the files you want to protect under their own directory, and in
    that directory add another web.config file specifying allow and deny.
     
    news-server.maine.rr.com, Feb 6, 2007
    #2
    1. Advertising

  3. Hi Max,

    In addition to that, you can use location element:

    <system.web>

    <authentication mode="Forms">
    <forms loginUrl="login.aspx" name="AuthCookie" path="/" timeout="20"/>
    </authentication>

    <!-- allow everyone too see all pages -->
    <authorization>
    <allow users="*"/>
    </authorization>

    </system.web>

    <!-- restrict access to few confidential pages -->
    <location path="confidentialUpdatePage1.aspx">
    <system.web>
    <authorization>
    <deny users="?"/>
    </authorization>
    </system.web>
    </location>

    <location path="confidentialUpdatePage2.aspx">
    <system.web>
    <authorization>
    <deny users="?"/>
    </authorization>
    </system.web>
    </location>

    --
    Milosz


    "news-server.maine.rr.com" wrote:

    >
    > "Max Turavani" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > Is there any way I can cause a login page to appear, using Forms
    > > authentication of course, when access a particular page only. In my case,
    > > I
    > > am building a site for rental properties. There are a group of files (
    > > HTML,
    > > ASPX files ) that are freely publicly accessable. There are certain pages
    > > however that my client will use to update their listings and images. I
    > > would
    > > like those pages ONLY to be redirected to the login page but NOT the
    > > publicly
    > > accessible files. Is there a way to target URL redirection using forms
    > > authentication for certain files that you specify.
    > >
    > > Thanks,
    > >
    > > Max

    >
    > Hi Max,
    >
    > Just put all the files you want to protect under their own directory, and in
    > that directory add another web.config file specifying allow and deny.
    >
    >
    >
    >
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Feb 6, 2007
    #3
  4. Thanks everyone for your responses !!!
    I used the location tag option and it worked like a charm !!!!

    Thanks again !!!

    "Milosz Skalecki [MCAD]" wrote:

    > Hi Max,
    >
    > In addition to that, you can use location element:
    >
    > <system.web>
    >
    > <authentication mode="Forms">
    > <forms loginUrl="login.aspx" name="AuthCookie" path="/" timeout="20"/>
    > </authentication>
    >
    > <!-- allow everyone too see all pages -->
    > <authorization>
    > <allow users="*"/>
    > </authorization>
    >
    > </system.web>
    >
    > <!-- restrict access to few confidential pages -->
    > <location path="confidentialUpdatePage1.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?"/>
    > </authorization>
    > </system.web>
    > </location>
    >
    > <location path="confidentialUpdatePage2.aspx">
    > <system.web>
    > <authorization>
    > <deny users="?"/>
    > </authorization>
    > </system.web>
    > </location>
    >
    > --
    > Milosz
    >
    >
    > "news-server.maine.rr.com" wrote:
    >
    > >
    > > "Max Turavani" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > Is there any way I can cause a login page to appear, using Forms
    > > > authentication of course, when access a particular page only. In my case,
    > > > I
    > > > am building a site for rental properties. There are a group of files (
    > > > HTML,
    > > > ASPX files ) that are freely publicly accessable. There are certain pages
    > > > however that my client will use to update their listings and images. I
    > > > would
    > > > like those pages ONLY to be redirected to the login page but NOT the
    > > > publicly
    > > > accessible files. Is there a way to target URL redirection using forms
    > > > authentication for certain files that you specify.
    > > >
    > > > Thanks,
    > > >
    > > > Max

    > >
    > > Hi Max,
    > >
    > > Just put all the files you want to protect under their own directory, and in
    > > that directory add another web.config file specifying allow and deny.
    > >
    > >
    > >
    > >
     
    =?Utf-8?B?TWF4IFR1cmF2YW5p?=, Feb 6, 2007
    #4
    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. Paul Cook
    Replies:
    1
    Views:
    406
    Harley
    Aug 7, 2003
  2. Eric
    Replies:
    2
    Views:
    1,542
    Tommy
    Feb 13, 2004
  3. Paul Aspinall
    Replies:
    1
    Views:
    371
    Mark Fitzpatrick
    Oct 1, 2006
  4. Eric
    Replies:
    2
    Views:
    605
  5. Felix Wafytech
    Replies:
    2
    Views:
    152
    Steven Cheng[MSFT]
    Jul 19, 2006
Loading...

Share This Page